/* Inline task; only evidence images use a dialog. */
.case-pilot .case-history{margin:12px 0 0}
.case-pilot .case-history summary{font-size:14px}
.case-pilot .case-history h4{margin-top:14px}
.case-pilot .case-progressive-running{padding:12px;border:0;border-radius:0}
.case-pilot .case-progressive-running>h3{display:none}
.case-pilot .case-workspace{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:16px;align-items:start;scroll-margin-top:84px}
.case-pilot .case-workspace>*{min-width:0}
.case-pilot .case-clinical-context{position:relative;max-height:calc(100svh - 112px);overflow:auto;overscroll-behavior:contain}
.case-pilot .case-workspace .sz-task__situation{padding:14px;font-size:14px;line-height:1.5}
.case-pilot .case-workspace .case-quiz{margin:0;padding:12px;border:1px solid #c8dadd;border-radius:8px;max-height:calc(100svh - 112px);overflow:auto;overscroll-behavior:contain}
.case-pilot .case-workspace .case-status{font-size:12px;line-height:18px;margin:0;color:#245f69}
.case-pilot .case-workspace .case-quiz>p:not(.case-status){font-size:12px;line-height:18px;margin:2px 0 6px;color:#50616a}
.case-pilot .case-workspace .case-quiz legend{font-size:15px;line-height:1.35;margin:4px 0 8px;padding:0;font-weight:700}
.case-pilot .case-workspace .case-quiz fieldset{min-width:0;margin:0;padding:0}
.case-pilot .case-workspace .case-quiz label{gap:8px;padding:7px 9px;margin:4px 0;min-height:40px;font-size:14px;line-height:1.35;border-radius:6px;align-items:center}
.case-pilot .case-workspace .case-quiz input{width:18px;height:18px;flex:0 0 18px;margin:0;align-self:center}
.case-pilot .case-workspace .case-quiz .btn{font-size:14px;line-height:20px;padding:8px 12px;margin-top:8px;min-height:38px}
.case-pilot .case-workspace .case-back{background:#fff;border:1px solid #245f69;color:#245f69;margin-left:6px}
.case-pilot .case-pane-switch{display:none}
.case-pilot .case-obtained{margin-top:16px}
.case-pilot .case-obtained>h4{font-size:16px;font-weight:800;margin:0 0 8px}
.case-pilot .case-evidence-help,.case-pilot .case-evidence-notice{font-size:12px;line-height:1.5;margin:6px 0;color:#50616a}
.case-pilot .case-obtained>.case-back{font-size:13px;padding:6px 10px;margin:4px 0}
.case-pilot .case-evidence-notice:empty,.case-pilot .case-evidence-inline:empty{display:none}
.case-pilot .case-obtained-card{padding:12px;margin:10px 0;border:1px solid #c8dadd;border-left:3px solid #3a8a98;border-radius:6px;background:#f3f8f9}
.case-pilot .case-evidence-original-card h4{font-size:15px;font-weight:700;margin:0 0 6px}
.case-pilot .case-evidence-original-card p{font-size:14px;line-height:1.45;margin:6px 0;overflow-wrap:anywhere}
.case-pilot .case-evidence-original-card img{display:block;max-width:100%;max-height:240px;width:auto;height:auto;object-fit:contain;margin:auto;border-radius:4px}
.case-pilot .case-result-image{display:block;color:#245f69}
.case-pilot .case-result-image::after{content:'Увеличить изображение';display:block;font-size:12px;line-height:18px;margin:4px 0}
.case-pilot .case-result-image:has(span)::after{display:none}
.case-pilot .case-quiz label>span{min-width:0;overflow-wrap:anywhere}
.case-pilot .case-quiz label img{max-width:100%;max-height:180px;object-fit:contain}
.case-pilot .case-result-table{display:flex;flex-wrap:wrap;gap:0;margin:8px 0;border:1px solid #c8dadd;font-size:14px;line-height:1.4}
.case-pilot .case-result-table>span{padding:6px 8px;border:1px solid #dce6e8;overflow-wrap:anywhere;max-width:100%}
.case-pilot .case-table-scroll{max-width:100%;overflow:auto;margin:10px 0}
.case-pilot .case-table-scroll table{border-collapse:collapse;width:100%;font-size:14px;line-height:1.4;background:white}
.case-pilot .case-table-scroll th,.case-pilot .case-table-scroll td{border:1px solid #c8dadd;padding:7px 9px;text-align:left;vertical-align:top;overflow-wrap:anywhere}
.case-pilot .case-table-scroll th{background:#eaf3f4;font-weight:700}
.case-pilot .case-obtained[hidden]{display:none}
.case-pilot .case-result-image span{display:block;font-size:12px;line-height:18px;margin-top:6px}
.case-pilot .case-result-image:focus-visible,.case-pilot .case-pane-switch button:focus-visible{outline:3px solid #c69a3a;outline-offset:2px}
.case-pilot .case-evidence-source{margin:14px 0}
.case-image-open{overflow:hidden}
.case-image-dialog{position:fixed;inset:0;margin:auto;width:min(1100px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:12px;border:1px solid #c8dadd;border-radius:10px;background:#fff;color:#22343b;box-shadow:0 18px 80px #0006;overflow:auto}
.case-image-dialog::backdrop{background:#0b242bd9}
.case-image-dialog[open]{display:flex;flex-direction:column;align-items:center;gap:10px}
.case-image-dialog img{display:block;max-width:100%;max-height:calc(100dvh - 140px);object-fit:contain;flex-shrink:1;min-height:0}
.case-image-dialog p{font-size:13px;line-height:1.4;margin:0;text-align:center}
.case-image-close{align-self:flex-end;flex-shrink:0;padding:8px 12px;background:#245f69;color:white;border:0;border-radius:6px;font-weight:700}
.case-image-close:focus-visible{outline:3px solid #c69a3a;outline-offset:3px}
@media(max-width:950px){
 .case-pilot .case-workspace{grid-template-columns:minmax(0,1fr);gap:6px;scroll-margin-top:8px}
 .case-pilot .case-pane-switch{display:flex;gap:6px}
 .case-pilot .case-pane-switch button{flex:1;padding:6px 8px;border:1px solid #245f69;border-radius:5px;background:#fff;color:#245f69;font-size:13px;line-height:18px;font-weight:700;min-height:32px}
 .case-pilot .case-pane-switch button[aria-pressed=true]{background:#245f69;color:#fff}
 .case-pilot .case-workspace[data-pane=question] .case-clinical-context,.case-pilot .case-workspace[data-pane=context] .case-quiz{display:none}
 .case-pilot .case-clinical-context,.case-pilot .case-workspace .case-quiz{max-height:calc(100svh - 120px)}
 .case-pilot .case-workspace .case-quiz{padding:8px 0;border:0;border-radius:0}
 .case-pilot .case-workspace .case-quiz>.case-results-link{display:none}
 .case-pilot .case-workspace .case-quiz .case-evidence-inline{font-size:12px;margin:4px 0}
 .case-pilot .case-progressive-running{padding:0;margin-top:16px}
 .case-pilot .case-workspace .case-quiz .btn{font-size:13px;padding:7px 10px}
}

@media(max-width:950px){
 .case-pilot .case-workspace .case-quiz:has(fieldset){display:flex;flex-wrap:wrap;align-content:flex-start;gap:0 6px}
 .case-pilot .case-workspace .case-quiz:has(fieldset)>p,.case-pilot .case-workspace .case-quiz:has(fieldset)>fieldset{flex-basis:100%;width:100%}
 .case-pilot .case-workspace .case-quiz .btn{flex:0 0 auto}
 .case-pilot .case-workspace .case-quiz .case-back{margin-left:0}
 .case-pilot .case-workspace .case-quiz .case-evidence-inline{order:1}
}

.case-results-open{overflow:hidden}
.case-pilot .case-results-dialog{position:fixed;inset:0;margin:auto;width:min(820px,calc(100vw - 16px));max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);padding:12px;border:1px solid #c8dadd;border-radius:8px;background:#fff;color:#22343b;overflow:hidden}
.case-pilot .case-results-dialog[open]{display:flex;flex-direction:column;gap:8px}
.case-results-dialog::backdrop{background:#0b242bd9}
.case-results-header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}
.case-pilot .case-results-header h3{font-size:16px;line-height:1.3;margin:0}
.case-results-header button{font-size:13px;white-space:nowrap}
.case-results-body{overflow:auto;min-height:0;overscroll-behavior:contain}
.case-pilot .case-results-body .case-obtained-card{margin:0 0 8px;padding:10px}
@media(max-width:950px){.case-pilot .case-pane-switch button{font-size:12px;padding:6px 3px;white-space:nowrap}.case-pilot .case-pane-switch button:disabled{opacity:.5}.case-pilot .case-results-header h3{font-size:15px}}

/* Start screen: show the action first, expand the full history on demand. */
.case-pilot #demo{padding-top:16px;scroll-margin-top:84px}
.case-pilot #demo>.container>.case-eyebrow{display:none}
.case-pilot #demo>.container>h2{font-size:24px;line-height:1.2;margin:0 0 8px}
.case-pilot #demo .case-composition{font-size:13px;line-height:20px;margin:0 0 10px}
.case-pilot #demo .sz-task:not(.case-progressive-running){padding:14px;margin-top:10px}
.case-pilot #demo .sz-task:not(.case-progressive-running)>h3{font-size:17px;margin:0 0 10px}
.case-pilot #demo .sz-task:not(.case-progressive-running) .sz-task__situation{padding:12px;font-size:14px;line-height:1.45}
.case-pilot #demo .sz-task:not(.case-progressive-running) .sz-task__situation>p{margin:0}
.case-pilot #demo .sz-task:not(.case-progressive-running)>button.case-primary{display:block;width:100%;padding:10px 12px;margin:12px 0;font-size:15px;line-height:22px;min-height:44px}
.case-pilot #demo .case-history summary{font-size:13px;line-height:20px;padding:8px 0;min-height:36px}
@media(max-width:950px){.case-pilot #demo{padding-top:12px;scroll-margin-top:8px}.case-pilot #demo .sz-task:not(.case-progressive-running){padding:12px}}

/* Desktop uses the available height and comfortable type; mobile stays compact. */
@media(min-width:951px){
 .case-pilot .case-progressive-running{padding:0;margin-top:16px}
 .case-pilot .case-workspace{height:calc(100dvh - 200px);min-height:420px;max-height:820px;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);align-items:stretch;gap:22px}
 .case-pilot .case-clinical-context{height:100%;min-height:0;max-height:none;overflow:hidden;display:flex;flex-direction:column;gap:14px}
 .case-pilot .case-workspace .sz-task__situation{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px;font-size:16px;line-height:1.5}
 .case-pilot .case-workspace .case-history summary{font-size:15px;line-height:1.4}
 .case-pilot .case-workspace .case-history h4{font-size:16px;margin:14px 0 6px}
 .case-pilot .case-history h4+br{display:none}
 .case-pilot .case-obtained{margin:0;max-height:44%;min-height:0;display:flex;flex-direction:column}
 .case-pilot .case-obtained>h4{font-size:17px;flex-shrink:0;margin-bottom:6px}
 .case-pilot .case-evidence-help,.case-pilot .case-evidence-notice{font-size:14px;line-height:1.45;flex-shrink:0}
 .case-pilot .case-obtained-list{overflow:auto;min-height:0;overscroll-behavior:contain}
 .case-pilot .case-obtained>.case-back{align-self:flex-start;flex-shrink:0;font-size:14px;line-height:20px;padding:8px 12px;margin:8px 0 0}
 .case-pilot .case-workspace .case-quiz{height:100%;min-height:0;max-height:none;padding:20px;font-size:16px}
 .case-pilot .case-workspace .case-status{font-size:14px;line-height:20px;margin-bottom:4px}
 .case-pilot .case-workspace .case-quiz>p:not(.case-status){font-size:14px;line-height:20px;margin:4px 0 10px}
 .case-pilot .case-workspace .case-quiz legend{font-size:18px;line-height:1.4;margin:4px 0 12px}
 .case-pilot .case-workspace .case-quiz label{font-size:16px;line-height:1.45;padding:10px 12px;margin:6px 0;min-height:46px;gap:10px}
 .case-pilot .case-workspace .case-quiz input{width:20px;height:20px;flex-basis:20px}
 .case-pilot .case-workspace .case-quiz .btn{font-size:15px;line-height:22px;padding:10px 14px;margin-top:12px}
 .case-pilot .case-workspace .case-evidence-original-card p{font-size:16px}
}
/* Long answers scroll inside the question; its action stays on the phone screen. */
@media(max-width:950px){
 .case-pilot .case-clinical-context,.case-pilot .case-workspace .case-quiz{max-height:calc(100dvh - 170px)}
 .case-pilot .case-workspace .case-quiz:has(fieldset){display:grid;grid-template-columns:max-content minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;height:calc(100dvh - 170px);max-height:none;gap:4px 6px;overflow:hidden;align-content:stretch}
 .case-pilot .case-workspace .case-quiz:has(fieldset)>p,.case-pilot .case-workspace .case-quiz:has(fieldset)>fieldset{grid-column:1/-1;width:100%;min-width:0}
 .case-pilot .case-workspace .case-quiz:has(fieldset)>fieldset{min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:4px;margin:0}
 .case-pilot .case-workspace .case-quiz:has(fieldset)>.case-primary{grid-row:4;grid-column:1;margin:0}
 .case-pilot .case-workspace .case-quiz:has(fieldset)>.case-back:not(.case-results-link){grid-row:4;grid-column:2;justify-self:start;margin:0}
 .case-pilot .case-workspace .case-quiz:has(fieldset)>.case-evidence-inline{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
}
