/* Study pilot: editorial I1 shell; reading and writing controls remain deliberately quiet. */
.study-nav{display:flex;gap:3px;margin-left:26px;min-width:0}.study-nav button{min-height:30px;padding:5px 9px;border-radius:4px;color:var(--muted);font-size:.84rem}.study-nav button:hover,.study-nav button:focus-visible,.study-nav button[aria-current="true"]{background:var(--panel-2);color:var(--ink);outline:2px solid transparent}.study-nav button:focus-visible{outline-color:var(--rose);outline-offset:2px}.study-surface{width:min(100%,1160px);margin:auto;padding:20px 0 56px}.study-surface-head{display:grid;gap:8px;margin-bottom:24px;border-left:2px solid var(--rose);padding-left:16px}.study-surface-head h1{margin:0;font-size:clamp(2rem,4vw,3.1rem);letter-spacing:-.04em;line-height:1.04}.study-surface-head p{margin:0;max-width:62ch}.study-back{justify-self:start;margin-top:4px}.case-hub,.visual-hub{display:grid;grid-template-columns:minmax(270px,.7fr) minmax(0,1.3fr);gap:26px;align-items:start}.study-form,.study-history,.case-reader,.case-writer,.visual-reader,.case-feedback{border:1px solid var(--line);background:var(--panel);box-shadow:var(--shadow);border-radius:10px}.study-form{display:grid;gap:12px;padding:18px}.study-form h2,.study-history h2{margin:0;font-size:1.12rem}.study-form label{display:grid;gap:5px;color:var(--muted);font-size:.87rem}.study-form input,.study-form select,.case-writer textarea{width:100%;border:1px solid var(--line);border-radius:5px;background:#101923;color:var(--ink);font:inherit;padding:9px}.study-form input:focus-visible,.study-form select:focus-visible,.case-writer textarea:focus-visible{outline:2px solid var(--rose);outline-offset:2px}.study-history{min-height:180px;padding:18px}.study-history-list{display:grid;margin-top:10px;border-top:1px solid var(--line)}.study-history-item{display:grid;gap:3px;width:100%;text-align:left;padding:12px 4px;border-radius:0;border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent)}.study-history-item:hover,.study-history-item:focus-visible{background:var(--panel-2);padding-left:10px}.study-status{display:flex;align-items:center;gap:10px;padding:18px;border:1px solid var(--line);background:var(--panel);border-radius:8px}.study-status p{margin:0}.study-error{display:grid;justify-items:start;border-color:var(--bad)}.study-spinner{width:15px;height:15px;border:2px solid var(--line);border-top-color:var(--rose);border-radius:50%;animation:study-spin .8s linear infinite}.case-desk{display:grid;grid-template-columns:minmax(280px,.82fr) minmax(420px,1.18fr);gap:20px;align-items:start}.case-reader{position:sticky;top:14px;max-height:calc(100dvh - 130px);overflow:auto;padding:22px}.case-reader h2,.case-writer h2,.case-feedback h2,.visual-reader h1{margin:5px 0 13px}.case-reader p{white-space:pre-wrap}.case-questions{display:grid;gap:12px;padding-left:22px}.case-questions li{padding-left:4px}.case-writer{display:grid;gap:12px;padding:22px}.case-writer textarea{min-height:calc(100dvh - 290px);line-height:1.65;resize:vertical}.case-editor-actions{display:flex;flex-wrap:wrap;align-items:center;gap:9px}.form-status{margin:0;color:var(--muted);font-size:.85rem}.form-status.error{color:var(--bad)}.study-sources{display:block;margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}.study-sources summary{cursor:pointer;color:var(--rose);font-size:.84rem}.study-source-list{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.study-source{min-height:26px;padding:3px 7px;border-color:var(--line);border-radius:3px;color:var(--rose);font-size:.79rem}.study-source:hover,.study-source:focus-visible{background:var(--wine);border-color:var(--rose)}.case-feedback{grid-column:1/-1;padding:22px}.feedback-question{padding:14px 0;border-top:1px solid var(--line)}.feedback-question h3,.feedback-question h4{margin:0 0 6px}.feedback-question p,.feedback-question ul{margin:6px 0}.visual-reader{padding:24px}.visual-reader>p{max-width:68ch}.study-map{margin:22px 0;padding:16px;border:1px solid var(--line);background:#101923;border-radius:6px}.study-map-controls{display:flex;align-items:center;gap:6px;margin-bottom:8px;color:var(--muted);font-size:.82rem}.study-map-controls .tool:first-of-type{margin-left:auto}.study-map>svg{display:block;width:100%;height:min(58vw,520px);min-height:260px;touch-action:none;cursor:grab}.study-map>svg:active{cursor:grabbing}.study-map-edge{stroke:var(--line);stroke-width:2;fill:none}.study-map-edge-label{fill:var(--muted);font:12px ui-sans-serif,system-ui;paint-order:stroke;stroke:#101923;stroke-width:5px;stroke-linejoin:round}.study-map-node rect{fill:var(--panel-2);stroke:var(--rose);stroke-width:1.5}.study-map-node:hover rect,.study-map-node:focus rect{fill:var(--wine);stroke:var(--ink);stroke-width:2}.study-map-node:focus{outline:none}.study-map-node-label{fill:var(--ink);font:600 13px ui-sans-serif,system-ui}.study-map-text{display:grid;gap:9px;padding-left:22px}.study-map-text details{margin-top:5px}.limitations{margin-top:18px;padding:10px 12px;border-left:2px solid var(--rose);background:#101923;color:var(--muted)}@keyframes study-spin{to{transform:rotate(360deg)}}@media (max-width:800px){.study-nav{order:3;overflow:auto;width:100%;margin:0;padding:2px 0}.topbar{flex-wrap:wrap;min-height:92px;align-content:center;gap:4px}.topbar-brand{margin-left:0}.top-actions{margin-left:auto}.study-surface{padding-top:12px}.case-hub,.visual-hub,.case-desk{grid-template-columns:1fr}.case-reader{position:static;max-height:none}.case-writer textarea{min-height:360px}.case-feedback{grid-column:auto}.study-map{padding:12px}.study-map>svg{height:340px}}@media (max-width:430px){.study-surface-head h1{font-size:2rem}.study-form,.study-history,.case-reader,.case-writer,.visual-reader,.case-feedback{padding:15px}.case-editor-actions .form-status{width:100%}}@media (prefers-reduced-motion:reduce){.study-spinner{animation:none}}
.case-surface{width:min(100%,1160px);height:calc(100dvh - 54px);min-height:620px;margin:auto;padding:14px 0 18px;display:flex;flex-direction:column}.case-page-head{display:flex;align-items:center;gap:12px;min-height:40px;margin:0 0 12px}.case-page-head .study-back{margin:0}.case-page-title{margin:0;font-size:1.15rem;letter-spacing:-.015em}.case-surface .case-desk{flex:1;min-height:0;align-items:stretch}.case-surface .case-reader,.case-surface .case-writer{min-height:0;max-height:none;height:100%;position:static}.case-surface .case-reader{overflow:auto}.case-surface .case-writer{display:flex;flex-direction:column}.case-surface .case-writer textarea{flex:1;min-height:180px;height:auto}.case-surface .case-editor-actions{position:sticky;bottom:0;padding-top:10px;background:var(--panel);border-top:1px solid var(--line)}.case-surface .case-feedback{max-height:38dvh;overflow:auto}.study-map-node-label{font-size:16px}@media (max-width:800px){.case-surface{height:auto;min-height:0;padding-top:8px}.case-surface .case-desk{display:flex;flex-direction:column}.case-surface .case-reader{max-height:34dvh}.case-surface .case-writer{min-height:58dvh}.case-surface .case-feedback{max-height:none}}
.visual-surface{width:min(100%,1160px);min-height:calc(100dvh - 54px);margin:auto;padding:14px 0 30px}.visual-page-head{display:flex;align-items:center;gap:12px;min-height:40px;margin:0 0 12px}.visual-page-head .study-back{margin:0}.visual-page-title{margin:0;font-size:1.15rem;letter-spacing:-.015em}.study-map-detail{display:grid;gap:7px;margin-top:12px;padding:12px 0;border-top:1px solid var(--line)}.study-map-detail h3,.study-map-detail p{margin:0}.study-map-relation{color:var(--muted);font-size:.86rem}.study-map-detail-sources{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.study-map-detail-sources strong{font-size:.86rem;margin-right:2px}.study-map-edge-group{cursor:pointer}.study-map-edge-group:focus{outline:none}.study-map-edge-group:focus .study-map-edge,.study-map-edge-group:hover .study-map-edge,.study-map-edge-group.is-selected .study-map-edge{stroke:var(--rose);stroke-width:3}.study-map-edge-group:focus .study-map-edge-label,.study-map-edge-group:hover .study-map-edge-label,.study-map-edge-group.is-selected .study-map-edge-label{fill:var(--ink)}.study-map-node.is-selected rect{fill:var(--wine);stroke:var(--ink);stroke-width:2.5}.study-map-text-details{margin-top:12px}.study-map-text-details summary{cursor:pointer;color:var(--rose);font-size:.86rem}.study-map-text-item{display:block;width:100%;padding:6px;text-align:left;border-color:transparent;border-radius:3px}.study-map-text-item:hover,.study-map-text-item:focus-visible{background:var(--panel-2);border-color:var(--line)}@media (max-width:800px){.visual-surface{min-height:0;padding-top:8px}.visual-reader{padding:15px}}
.study-mermaid-canvas{max-height:min(68dvh,720px);overflow:auto;border:1px solid color-mix(in srgb,var(--line) 80%,transparent);background:var(--panel-2)}.study-mermaid-canvas>svg{display:block;min-width:620px;height:auto;min-height:360px;padding:14px;font-family:ui-sans-serif,system-ui,sans-serif}.study-mermaid-canvas .node{cursor:pointer}.study-mermaid-canvas .node:focus{outline:none}.study-mermaid-canvas .node rect{fill:var(--panel-2)!important;stroke:var(--rose)!important}.study-mermaid-canvas .node.is-selected rect,.study-mermaid-canvas .node:hover rect,.study-mermaid-canvas .node:focus rect{fill:var(--wine)!important;stroke:var(--ink)!important;stroke-width:2px}.study-mermaid-canvas .edgePath{cursor:pointer}.study-mermaid-canvas .edgePath.is-selected path,.study-mermaid-canvas .edgePath:hover path,.study-mermaid-canvas .edgePath:focus path{stroke:var(--rose)!important;stroke-width:3px}.study-map-render-error{margin:0;padding:16px;color:var(--muted)}@media (max-width:800px){.study-mermaid-canvas{max-height:58dvh}.study-mermaid-canvas>svg{min-width:560px;min-height:320px}}
.case-surface{box-sizing:border-box;overflow:hidden}.case-surface .case-desk{grid-template-rows:minmax(0,1fr) auto;overflow:hidden}.case-surface .case-feedback{min-height:0;margin:0}.case-surface .case-editor-actions{flex-shrink:0}@media (max-width:800px){.case-surface{overflow:visible}.case-surface .case-desk{overflow:visible}}
.case-surface:has(.case-evaluation){height:auto;min-height:0;overflow:visible;display:block;padding-bottom:42px}.case-surface:has(.case-evaluation) .case-desk{display:block;overflow:visible}.case-surface:has(.case-evaluation) .case-feedback{max-height:none;overflow:visible}.case-evaluation{width:min(100%,1020px);margin:auto}.case-evaluation-head{display:grid;gap:9px;margin:8px 0 18px;padding:0 0 18px 17px;border-left:3px solid var(--rose);border-bottom:1px solid var(--line)}.case-evaluation-head h1{margin:0;font-size:clamp(1.7rem,3vw,2.5rem);letter-spacing:-.035em}.case-evaluation-head p{max-width:76ch;margin:0}.evaluation-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px}.evaluation-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:24px;align-items:start}.evaluation-index{position:sticky;top:14px;display:grid;gap:5px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}.evaluation-index-item{width:100%;justify-content:flex-start;text-align:left;font-size:.84rem}.evaluation-content{display:grid;gap:14px}.evaluation-question{padding:21px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:var(--shadow);scroll-margin-top:18px}.evaluation-question h2{margin:4px 0 18px;font-size:1.2rem}.evaluation-question h3{margin:18px 0 7px;font-size:.9rem}.evaluation-answer{padding:12px 14px;border-left:2px solid var(--line);background:var(--panel-2);white-space:pre-wrap;line-height:1.62}.evaluation-status{margin:0;color:var(--muted);font-weight:650}.evaluation-good{color:var(--ok)}.evaluation-needs{color:var(--rose)}@media (max-width:800px){.evaluation-layout{grid-template-columns:1fr;gap:14px}.evaluation-index{position:static;grid-template-columns:repeat(auto-fit,minmax(115px,1fr))}.case-surface:has(.case-evaluation){padding:8px 0 26px}.case-evaluation-head,.evaluation-question{padding-left:15px;padding-right:15px}}
.case-surface .case-feedback{max-height:none;overflow:visible}
.study-grade{display:grid;gap:8px;margin-top:8px;padding:15px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.study-grade h2,.study-grade h3,.study-grade p{margin:0}.study-grade h2{font-size:1.35rem}.study-grade>details{margin-top:2px}.study-grade summary,.study-grade-question summary{cursor:pointer;color:var(--rose);font-size:.9rem}.study-grade-breakdown{display:grid;gap:10px;margin-top:11px}.study-grade-question{padding-top:10px;border-top:1px solid var(--line)}.study-grade-question>p,.study-grade-question li p{margin-top:4px;color:var(--muted);font-size:.9rem}.study-grade-question details{margin-top:7px}.study-grade-version{color:var(--muted);font-size:.8rem}
.study-mermaid-canvas>svg{background:#101923}.study-mermaid-canvas>svg text{fill:var(--ink)!important;font-family:ui-sans-serif,system-ui,sans-serif!important;font-size:15px!important;font-weight:500;text-anchor:middle}.study-mermaid-canvas>svg .node rect{rx:7px;ry:7px;fill:var(--panel-2)!important;stroke:var(--rose)!important;stroke-width:1.5px!important}.study-mermaid-canvas>svg .edgePaths path{fill:none!important;stroke:var(--muted)!important;stroke-width:1.6px!important;stroke-linecap:round;stroke-linejoin:round}.study-mermaid-canvas>svg marker path{fill:var(--muted)!important;stroke:none!important}.study-mermaid-canvas>svg .edgeLabels rect{fill:#101923!important;stroke:none!important}.study-mermaid-canvas>svg .edgeLabels text{fill:var(--muted)!important;font-size:12px!important}.study-mermaid-canvas>svg .edgePaths path.is-selected,.study-mermaid-canvas>svg .edgePaths path:hover,.study-mermaid-canvas>svg .edgePaths path:focus{stroke:var(--rose)!important;stroke-width:3px!important}.study-mermaid-canvas>svg .edgeLabels{pointer-events:none}
.study-mermaid-canvas>svg .edgeLabels{pointer-events:auto}
@media (max-width:800px){.workspace{grid-template-rows:96px minmax(0,1fr)}.topbar{min-height:96px;box-sizing:border-box}}
.case-surface .case-desk{display:block;overflow:auto;padding-right:2px}.case-scenario,.case-question-card{max-width:860px;margin:0 auto 16px;padding:22px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:var(--shadow)}.case-scenario summary{cursor:pointer;font-weight:650}.case-scenario p{white-space:pre-wrap}.case-progress{margin:16px 0 0;color:var(--muted);font-size:.9rem}.case-question-card h2{margin:0 0 8px;font-size:1.1rem}.case-question-card>p{white-space:pre-wrap}.case-question-card textarea{display:block;box-sizing:border-box;width:100%;min-height:210px;margin-top:16px;padding:11px;border:1px solid var(--line);border-radius:5px;background:#101923;color:var(--ink);font:inherit;line-height:1.6;resize:vertical}.case-question-card textarea:focus-visible{outline:2px solid var(--rose);outline-offset:2px}.case-question-card.is-submitted textarea,.case-question-card textarea[readonly]{background:var(--panel-2);color:var(--muted)}.case-question-card .case-editor-actions{margin-top:10px}.case-question-card .form-status{margin-top:9px}@media (max-width:800px){.case-surface .case-desk{overflow:visible}.case-scenario,.case-question-card{padding:16px}.case-question-card textarea{min-height:260px}}

.case-legacy-history{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}.case-legacy-history summary{cursor:pointer;font-weight:650}.case-legacy-entry{display:grid;gap:7px;padding:12px 0;border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent)}.case-legacy-entry textarea{width:100%;box-sizing:border-box;resize:vertical;padding:9px;border:1px solid var(--line);border-radius:5px;background:var(--panel-2);color:var(--muted);font:inherit;line-height:1.55}

/* A case uses the desk as its sole desktop scroll region; the top bar and case heading remain in view. */
main:has(.case-surface){overflow:hidden}
#view:has(.case-surface){box-sizing:border-box;height:100%;min-height:0;padding:0 44px;overflow-y:auto}
.case-surface .case-desk{scrollbar-gutter:stable}
.case-submitted-answer{box-sizing:border-box;width:100%;margin-top:16px;padding:11px;border:1px solid var(--line);border-radius:5px;background:var(--panel-2);color:var(--muted);font:inherit;line-height:1.6;white-space:pre-wrap}
@media (max-width:800px){main:has(.case-surface){overflow:auto}#view:has(.case-surface){height:auto;min-height:100%;padding:8px 18px 58px}.case-submitted-answer{min-height:0}}

/* Comparison diagrams retain Mermaid's coordinate width, so labels stay readable; pan with the canvas scrollbar. */
.study-mermaid-canvas>svg[width]{max-width:none}

.study-map-legend{margin-left:8px;font-size:.76rem;color:var(--muted)}.study-map-legend::before{display:inline-block;content:"";width:16px;margin-right:5px;border-top:2px solid var(--rose);vertical-align:middle}.study-map-legend.is-explanatory::before{border-top-style:dashed;border-color:var(--muted)}.study-mermaid-canvas .edgePaths path.is-explanatory{stroke-dasharray:6 4!important;stroke:var(--muted)!important}.study-map-article{display:grid;grid-template-columns:1fr auto;gap:10px;margin:12px 0;padding:16px;border:1px solid var(--rose);border-radius:7px;background:color-mix(in srgb,var(--panel-2) 90%,var(--wine));box-shadow:var(--shadow)}.study-map-article h3,.study-map-article p{margin:0}.study-map-article p{grid-column:1/-1;white-space:pre-wrap;line-height:1.6}.study-map-article small,.study-map-article .study-source{justify-self:start}.study-map-references{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:8px}.study-map-references strong{font-size:.86rem;margin-right:2px}.study-map-reference{min-height:28px;padding:4px 8px;border:1px solid var(--rose);border-radius:3px;background:var(--panel-2);color:var(--ink);font:inherit;font-size:.8rem}.study-map-reference:hover,.study-map-reference:focus-visible{background:var(--wine);outline:2px solid var(--rose);outline-offset:2px}@media (max-width:600px){.study-map-controls{flex-wrap:wrap}.study-map-legend{margin-left:0}.study-map-article{padding:12px}}

.study-map-article[hidden]{display:none}.study-map-legend.is-explicit::before{border-top-color:var(--rose)}.study-mermaid-canvas .node.legalRef rect{fill:#2a1c29!important;stroke:#d998ae!important;stroke-dasharray:3 2}.study-mermaid-canvas .node.legalRef text{font-size:13px!important;font-weight:650}.study-mermaid-canvas .edgePaths path{transition:stroke .12s ease,stroke-width .12s ease}.study-map-zoom{min-width:30px;padding:3px 7px}.study-map-zoom:first-of-type{margin-left:auto}@media (prefers-reduced-motion:reduce){.study-mermaid-canvas .edgePaths path{transition:none}}

.study-mermaid-canvas>svg tspan{font-family:ui-sans-serif,system-ui,sans-serif!important}.study-mermaid-canvas .edgePaths path.is-foundation{stroke-dasharray:4 4!important;stroke:#d998ae!important;stroke-width:1.35px!important}.study-map-article{width:100%;box-sizing:border-box;grid-template-columns:minmax(0,1fr) auto}.study-map-article>p,.study-map-article>small,.study-map-article>.study-source{grid-column:1/-1}.study-map-article>p{width:100%;box-sizing:border-box;white-space:normal}.study-map-article>small,.study-map-article>.study-source{justify-self:start}
.case-generation-progress{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:10px;padding:18px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}.case-generation-stage{margin:0;line-height:1.45}.case-generation-activity{grid-column:2;margin-top:2px}.case-generation-activity[hidden]{display:none}.case-generation-activity .journey-summary{margin:0;font-size:.86rem}.case-generation-activity .journey-steps{margin:9px 0 0;padding-left:20px}
.study-map-detail[hidden]{display:none}.study-map-article{scroll-margin-top:calc(54px + 14px)}@media (max-width:800px){.study-map-article{scroll-margin-top:calc(96px + 12px)}}

/* Article reading controls share the product's soft, tactile surfaces. */
.study-map-article>.quiet:not(.study-map-return){align-self:start;min-width:40px;min-height:40px;padding:5px;border-radius:8px;font-size:1.3rem}.study-map-article>.study-source{min-height:40px;padding:8px 12px;border-radius:8px;border:1px solid var(--rose);transition:background .15s ease,box-shadow .15s ease}.study-map-article>.study-source:hover{background:var(--wine);box-shadow:0 0 0 1px var(--rose)}.study-map-article>.study-source:focus-visible{outline:2px solid var(--ink);outline-offset:3px}.study-map-return{grid-column:1/-1;justify-self:start;min-height:44px}.study-map-article h3{align-self:start;line-height:1.4;font-family:inherit}


/* Map evidence is compact and local: no synthetic article nodes or inspector column. */
.study-map{position:relative}.study-map-body,.study-map.is-article-open .study-map-body{display:block;min-height:0}.study-map.is-article-open .study-map-body>.study-mermaid-canvas{display:block;height:auto;max-height:min(68dvh,720px)}.study-map.is-article-open .study-map-body>.study-map-article{position:absolute;z-index:4;top:54px;right:12px;width:min(360px,calc(100% - 24px));height:auto;min-height:0;max-height:min(56dvh,520px);margin:0;overflow:auto;align-content:start}.study-map-reference-badge{cursor:pointer}.study-map-reference-badge rect{fill:#2a1c29;stroke:#d998ae;stroke-width:1}.study-mermaid-canvas .node .study-map-reference-badge text{fill:#f5d8e2!important;font:600 10px ui-sans-serif,system-ui,sans-serif!important;pointer-events:none}.study-map-reference-badge:hover rect,.study-map-reference-badge:focus-visible rect{fill:var(--wine);stroke:#fff;stroke-width:2}.study-map-reference-badge:focus{outline:none}.study-map-node-icon{color:#d998ae;pointer-events:none}.study-map-expand{justify-self:start}.study-map-related-references{display:grid;gap:6px;grid-column:1/-1}.study-map-related-references strong{font-size:.84rem}.study-map-concept-icon{width:24px;height:24px}.study-map-detail:has(.study-map-concept-icon){grid-template-columns:28px minmax(0,1fr)}.study-map-detail>h3{font-family:inherit}.study-map-detail>p,.study-map-detail>.study-map-references,.study-map-detail>.study-map-detail-sources{grid-column:1/-1}.study-map-detail>.study-map-concept-icon{grid-column:1;grid-row:1}.study-map-detail>.study-map-concept-icon+*{grid-column:2;align-self:center}.study-mermaid-canvas .node.is-selected rect{stroke:#f0b9ca!important;stroke-width:3px!important}.study-mermaid-canvas .edgePaths path.is-selected{stroke:#f0b9ca!important;stroke-width:3px!important}@media (max-width:800px){.study-map.is-article-open .study-map-body>.study-map-article{position:fixed;inset:auto 0 0;width:100%;max-height:72dvh;min-height:0;padding:18px;border-radius:12px 12px 0 0}.study-map.is-article-open>.study-map-detail,.study-map.is-article-open>.study-map-text-details{display:none}.study-map-return{display:inline-flex}}
/* Mermaid controls scale; the initial view favors reading over full-diagram fit. */
.study-mermaid-canvas{background:#101923}.study-mermaid-canvas>svg{min-width:0;min-height:0;margin-inline:auto;padding:0;height:auto}.study-mermaid-canvas>svg text{font-size:16px!important}.study-mermaid-canvas .node .study-map-reference-badge text{font-size:11px!important}

/* Case continuity uses one quiet action and keeps programmatic return visible below the fixed shell. */
.case-continue{margin-top:12px}.case-question-card h2{scroll-margin-top:calc(96px + 16px)}.case-question-card h2:focus{outline:2px solid var(--rose);outline-offset:4px}.feedback-return{margin-top:10px}

/* Focus plus context preserves the whole graph while making the active branch scannable. */
.study-mermaid-canvas .node,.study-mermaid-canvas .edgePaths path,.study-mermaid-canvas .edgeLabels .label{transition:opacity .16s ease,stroke .16s ease,stroke-width .16s ease}.study-mermaid-canvas.has-focus-context .node.is-muted,.study-mermaid-canvas.has-focus-context .edgePaths path.is-muted,.study-mermaid-canvas.has-focus-context .edgeLabels .label.is-muted{opacity:.3}.study-mermaid-canvas.has-focus-context .node.is-context{opacity:1}.study-mermaid-canvas.has-focus-context .edgePaths path.is-context.is-explicit{stroke:#f0b9ca!important;stroke-width:2.8px!important}.study-mermaid-canvas.has-focus-context .edgePaths path.is-context.is-explanatory{stroke:#b8d8e8!important;stroke-width:2.4px!important;stroke-dasharray:7 4!important}.study-mermaid-canvas .edgeLabels .label.is-context{opacity:1}.study-mermaid-canvas .edgeLabels .label.is-explanatory text{fill:#b8d8e8!important}@media (prefers-reduced-motion:reduce){.study-mermaid-canvas .node,.study-mermaid-canvas .edgePaths path,.study-mermaid-canvas .edgeLabels .label{transition:none}}

/* Keep camera controls tactile while the legend consumes one compact region. */
.study-map-controls{gap:8px;padding:4px 0}.study-map-legend-group{display:flex;align-items:center;gap:10px;min-width:0;margin-right:auto}.study-map-legend{margin-left:0;white-space:nowrap}.study-map-zoom{min-height:36px;padding:5px 9px}@media (max-width:700px){.study-map-controls{gap:6px}.study-map-legend-group{width:100%;gap:8px}.study-map-zoom{min-height:38px;padding-inline:9px}}

/* The diagram owns the space; secondary explanation opens locally. */
#view:has(.is-map-reader){width:100%;max-width:none;box-sizing:border-box;padding:24px 32px 40px}
.visual-surface:has(.is-map-reader){width:min(100%,1440px)}
.visual-reader.is-map-reader{padding:0;border:0;background:transparent;box-shadow:none}
.visual-overview{margin:0 0 12px;max-width:84ch}
.visual-overview summary{width:fit-content;cursor:pointer;color:var(--muted);font-size:.86rem;padding:8px 0}
.visual-overview summary:hover,.visual-overview summary:focus-visible{color:var(--ink)}
.visual-overview p{line-height:1.65;margin:10px 0 18px}
.visual-overview .eyebrow{margin-top:12px}
.is-map-reader .study-map{margin:0;padding:0;border-radius:14px;overflow:hidden;background:#101923;box-shadow:0 14px 48px #0003}
.is-map-reader .study-map-controls{padding:10px 14px;margin:0;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--panel) 88%,transparent)}
.study-map-controls .study-map-zoom{min-height:40px;min-width:40px;border-radius:8px}
.study-map-controls .study-map-zoom:hover:not(:disabled){background:var(--panel-2);color:var(--ink)}
.study-map-controls .study-map-zoom:focus-visible{outline:2px solid var(--rose);outline-offset:1px}
.is-map-reader .study-mermaid-canvas,.is-map-reader .study-map.is-article-open .study-mermaid-canvas{height:clamp(360px,68dvh,780px);max-height:none;border:0;background:radial-gradient(circle,#ffffff13 1px,transparent 1px) 0 0/22px 22px,#101923;scrollbar-gutter:stable}
.is-map-reader .study-mermaid-canvas>svg{background:transparent}
.study-map-body{position:relative}
.study-map-body>.study-map-detail{position:absolute;z-index:3;top:12px;right:12px;width:min(380px,calc(100% - 24px));max-height:calc(100% - 24px);box-sizing:border-box;overflow:auto;margin:0;padding:20px;gap:12px;border:1px solid var(--rose);border-radius:12px;background:var(--panel);box-shadow:0 16px 46px #0007;grid-template-columns:minmax(0,1fr) 32px}
.study-map-detail:has(.study-map-concept-icon){grid-template-columns:24px minmax(0,1fr) 32px}
.study-map-detail>.study-map-detail-close{grid-column:-2;grid-row:1;align-self:start;min-height:32px;min-width:32px;font-size:1.2rem;border-radius:7px}
.study-map-detail h3{font-size:1.05rem;line-height:1.35}
.study-map-detail p{font-size:.94rem;line-height:1.65}
.study-map-detail-sources{padding-top:10px;border-top:1px solid var(--line)}
.study-map.is-article-open .study-map-body>.study-map-article{top:12px;border-radius:12px;box-shadow:0 16px 46px #0007}
.study-map-text-details{padding:12px 16px;margin:0;border-top:1px solid var(--line)}
.study-mermaid-canvas.has-focus-context .node.is-muted{opacity:.52}
.study-mermaid-canvas.has-focus-context .node.is-muted:hover,.study-mermaid-canvas.has-focus-context .node.is-muted:focus{opacity:1}
.study-map-dialog{inset:8px;width:calc(100% - 16px);height:calc(100dvh - 16px);max-width:none;max-height:none;box-sizing:border-box;margin:0;padding:0;border:1px solid var(--line);border-radius:14px;background:#101923;color:var(--ink);overflow:hidden}
.study-map-dialog::backdrop{background:#060d16cc;backdrop-filter:blur(6px)}
.study-map-dialog>.study-map{height:100%;width:100%;min-width:0;box-sizing:border-box;margin:0;padding:0;border:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
.study-map-dialog .study-map-controls{padding:10px 14px;margin:0;border-bottom:1px solid var(--line)}
.study-map-dialog .study-map-body{min-height:0;min-width:0}
.study-map-dialog .study-map-body>.study-mermaid-canvas{width:100%;box-sizing:border-box;height:100%!important;max-height:none!important;min-height:0;min-width:0;border:0;background:radial-gradient(circle,#ffffff13 1px,transparent 1px) 0 0/22px 22px,#101923}
.study-map-dialog .study-map-text-details{max-height:30dvh;overflow:auto}
@media(max-width:800px){
  #view:has(.is-map-reader){padding:12px 14px 32px}
  .is-map-reader .study-map-controls,.study-map-dialog .study-map-controls{padding:8px;gap:4px;flex-wrap:wrap}
  .study-map-controls .study-map-zoom{min-height:44px}
  .is-map-reader .study-mermaid-canvas,.is-map-reader .study-map.is-article-open .study-mermaid-canvas{height:62dvh;min-height:340px}
  .study-map-body>.study-map-detail,.study-map.is-article-open .study-map-body>.study-map-article{position:fixed;inset:auto 8px 8px;width:auto;max-height:64dvh;border-radius:14px;z-index:8}
}

.case-session-choice{width:min(100%,620px);margin:48px auto;padding:24px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:var(--shadow)}.case-session-choice h1{margin:5px 0 18px;letter-spacing:-.025em}.case-correction-choice{display:grid;grid-template-columns:auto 1fr;column-gap:9px;row-gap:3px;padding:12px 0;border-top:1px solid var(--line);cursor:pointer}.case-correction-choice input{grid-row:span 2;margin-top:4px}.case-correction-choice strong{display:block;line-height:1.25}.case-correction-choice span{color:var(--muted);font-size:.9rem;line-height:1.45}.case-session-choice>.primary{margin-top:16px}
