[data-simulator-explorer] { scroll-margin-top:4px; }
/* A control brought back into view keeps a little clear of the bottom edge. */
.ct-lab :is(button, input, select, summary) { scroll-margin-bottom:12px; }
.sim-intro .page-heading { margin-bottom:12px; }
.sim-intro .page-heading h1 { margin-bottom:4px; }
.sim-intro .lede { margin-bottom:0; }
.sim-explorer-tabs { display:flex; gap:4px; padding:3px; background:#eeeeee; border:1px solid #d4d4d4; border-radius:8px; margin:14px 0 12px; }
.sim-explorer-tabs a { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:8px 18px; border-radius:6px; color:#4d4d4d; text-decoration:none; font-weight:700; transition:background-color .14s ease,color .14s ease,box-shadow .14s ease; }
.sim-explorer-tabs a .icon { width:18px; height:18px; flex:none; color:#6e6e6e; transition:color .14s ease; }
@media(hover:hover) { .sim-explorer-tabs a:not([aria-selected=true]):hover { background:rgba(255,255,255,.6); color:#262323; } }
.sim-explorer-tabs a[aria-selected=true] { color:#1f1f1f; background:#fff; box-shadow:0 1px 3px rgba(21,21,21,.1),inset 0 -2px 0 #9b7630; }
.sim-explorer-tabs a[aria-selected=true] .icon { color:#8b6826; }
/* --ct-pin is the height of the sticky site header, which a pinned image sits under. */
.ct-lab { max-width:1400px; margin:auto; --ct-pin:72px; --ct-vh:100vh; }
/* A control brought into view stops 4px below what is pinned: the page already keeps --nav-clearance free
   at the top of the screen for every scroll, so only the difference from the image's own offset is added. */
.ct-lab { --ct-clear:calc(var(--ct-pin) - var(--nav-clearance, 0px) + 4px); }
/* The screen height with the browser's bars showing, so a pinned image does not resize as they hide. */
@supports (height:1svh) { .ct-lab { --ct-vh:100svh; } }
.ct-heading { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; margin-bottom:10px; }
.ct-lab .ct-heading h2 { font-size:21px; letter-spacing:-.015em; margin:0; }
.ct-lab .ct-notice { margin:0; padding:4px 10px; background:var(--light,#efefef); border:1px solid var(--line,#dddddd); border-radius:999px; font-size:11.5px; font-weight:600; color:var(--muted,#606060); }
.ct-lab #ct-status { font-size:12px; color:var(--muted,#606060); margin:0 0 0 auto; min-height:18px; }
/* The B-mode is the main image; the 3D view and CT section stack beside it. */
.ct-workspace { display:grid; grid-template-columns:244px minmax(0,1.6fr) minmax(0,1fr); grid-template-areas:"controls ultrasound anatomy" "controls ultrasound ct" "controls selection ct"; grid-template-rows:min-content min-content 1fr; gap:10px; align-items:start; }
.ct-lab fieldset { grid-area:controls; min-width:0; padding:12px; border:1px solid var(--line,#dddddd); border-radius:10px; margin:0; background:var(--paper,#fff); box-shadow:0 1px 3px rgba(21,21,21,.04); }
.ct-lab fieldset::after { content:""; display:table; clear:both; }
.ct-lab fieldset>legend { float:left; width:100%; display:flex; align-items:center; gap:8px; margin:0 0 9px; padding:0 0 8px; border-bottom:1px solid var(--line,#dddddd); font-size:14px; font-weight:700; color:var(--ink,#1d1d1d); }
.ct-lab fieldset>legend+* { clear:both; }
/* A wide screen shows all three views or a pair, chosen in the heading row; a phone also shows one view at a time. */
.ct-view-picker { display:inline-flex; flex-wrap:wrap; gap:2px; padding:2px; background:var(--light,#efefef); border:1px solid var(--line,#dddddd); border-radius:8px; }
.ct-view-picker :is([data-ct-view=ultrasound], [data-ct-view=ct], [data-ct-view="3d"]) { display:none; }
.ct-lab .ct-view-picker button { border:0; background:transparent; color:var(--muted,#606060); font-weight:600; border-radius:6px; padding:5px 11px; }
@media(hover:hover) { .ct-lab .ct-view-picker button:not([aria-pressed=true]):hover:not(:disabled) { background:rgba(255,255,255,.65); color:var(--ink,#1d1d1d); } }
.ct-lab .ct-view-picker button[aria-pressed=true], .ct-lab .ct-view-picker button[aria-pressed=true]:hover:not(:disabled) { background:var(--paper,#fff); color:var(--ink,#1d1d1d); font-weight:700; box-shadow:0 1px 2px rgba(21,21,21,.09); }
/* With a mouse the view buttons are no taller than the heading's notice, so the views below keep their room. */
@media(min-width:761px) and (pointer:fine) { .ct-lab .ct-view-picker button { min-height:28px; padding-block:3px; } }
.ct-lab legend, .ct-lab label { font-weight:700; }
.ct-probe-icon { width:24px; height:31px; margin:0; flex:none; }
.ct-buttons { display:flex; flex-wrap:wrap; gap:6px; }
/* The colour is set because an iPhone draws unstyled button text in system blue. */
.ct-lab button { min-height:44px; padding:8px 10px; border:1px solid var(--line-strong,#c2c2c2); background:var(--paper,#fff); color:#333; border-radius:6px; line-height:1.2; font-size:12.5px; font-weight:600; cursor:pointer; transition:background-color .12s ease,border-color .12s ease,color .12s ease; }
/* Only where a pointer can hover: on a touch screen the hover look stays on whatever sits under the last tap. */
@media(hover:hover) { .ct-lab button:hover:not(:disabled) { border-color:var(--accent,#8b6826); background:#fafafa; } }
/* A chosen button keeps its chosen look under a pointer, and under the hover a touch screen leaves behind after a tap. */
.ct-lab button[aria-pressed=true], .ct-lab button[aria-pressed=true]:hover:not(:disabled) { background:var(--accent-soft,#fbf6e8); border-color:var(--accent,#8b6826); box-shadow:inset 0 0 0 1px var(--accent,#8b6826); color:var(--ink,#1d1d1d); font-weight:700; }
.ct-lab button:disabled { opacity:.48; cursor:default; }
.ct-lab button:focus-visible, .ct-lab input:focus-visible, .ct-lab summary:focus-visible { outline:3px solid #4c7a9e; outline-offset:2px; }
/* The four starting windows sit in a compact 2x2 grid so the sliders stay near the top. */
.ct-presets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
.ct-presets button { padding:6px 5px; font-size:12px; }
@media(min-width:761px) and (pointer:fine) { .ct-lab .ct-presets button { min-height:34px; padding-block:4px; } }
@media(min-width:1051px) and (pointer:fine) { .ct-lab .ct-slider-row button { flex:0 0 30px; min-width:30px; min-height:30px; padding:2px; font-size:15px; } .ct-lab .ct-probe-actions button { min-height:34px; } }
.ct-prf-hint { font-size:11.5px; color:#7a5818; font-weight:600; }
.ct-lab #ct-window { margin:8px 0 4px; font-size:13px; font-weight:600; color:var(--muted,#606060); }
.ct-lab .ct-probe-tip { margin:0 0 9px; font-size:12px; line-height:1.42; color:var(--muted,#606060); }
.ct-sliders { display:grid; gap:7px 14px; }
.ct-slider { min-width:0; }
.ct-slider-heading { display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:12px; margin-bottom:2px; }
.ct-sliders label { margin:0; font-size:12px; font-weight:600; color:var(--ink-soft,#363636); }
.ct-sliders output { font-weight:600; color:var(--muted,#606060); font-variant-numeric:tabular-nums; }
.ct-slider-row { display:flex; align-items:center; gap:5px; }
.ct-slider-row button { flex:0 0 32px; min-width:32px; padding:4px; font-size:16px; }
.ct-sliders input { display:block; width:100%; min-width:0; height:28px; margin:0; padding:0; accent-color:var(--accent,#8b6826); }
.ct-movement-guide { margin:6px 0; }
.ct-movement-guide dt { font-weight:700; margin-top:8px; color:var(--ink,#1d1d1d); }
.ct-movement-guide dd { margin:2px 0 0; line-height:1.4; color:var(--muted,#606060); }
.ct-probe-actions { margin-top:8px; }
.ct-probe-actions button { flex:1; }
.ct-lab .ct-probe-help { font-size:12px; margin-top:8px; padding:0; border-bottom:0; border-top:1px solid var(--line,#dddddd); }
.ct-probe-help summary { cursor:pointer; min-height:36px; display:flex; align-items:center; gap:7px; font-size:12px; font-weight:600; color:var(--ink-soft,#363636); list-style:none; }
.ct-probe-help summary::-webkit-details-marker { display:none; }
.ct-probe-help summary::before { content:"+"; display:inline-grid; place-items:center; width:18px; height:18px; border-radius:4px; background:var(--light,#efefef); border:1px solid var(--line,#dddddd); color:var(--muted,#606060); font-size:12px; font-weight:700; line-height:1; flex:none; }
.ct-probe-help[open] summary::before { content:"−"; background:var(--accent-soft,#fbf6e8); border-color:var(--accent,#8b6826); color:var(--accent,#8b6826); }
/* Clipping keeps the rounded corners without making the figure a scroll box, so a view inside it can pin to the page. */
.ct-workspace figure { margin:0; min-width:0; border:1px solid var(--line,#dddddd); border-radius:10px; box-shadow:0 1px 3px rgba(21,21,21,.04); overflow:hidden; overflow:clip; background:var(--paper,#fff); }
/* One line where it fits: the view's name, then what it shows. */
.ct-workspace figcaption { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 8px; padding:6px 11px; background:#fafafa; border-bottom:1px solid var(--line,#dddddd); font-size:13.5px; line-height:1.4; }
.ct-workspace figcaption span { font-size:11.5px; color:var(--muted,#606060); }
.ct-viewport { aspect-ratio:4/3; position:relative; overflow:hidden; background:#0e1115; }
.ct-overview .ct-viewport { aspect-ratio:auto; height:270px; }
.ct-body-hud { position:absolute; inset:8px 10px auto; display:flex; justify-content:space-between; align-items:flex-start; gap:8px; font:600 11px/1.3 system-ui,sans-serif; color:rgba(242,245,250,.94); text-shadow:0 1px 3px rgba(0,0,0,.95),0 0 8px rgba(0,0,0,.65); pointer-events:none; z-index:1; }
.ct-body-hud span:last-child { white-space:nowrap; flex:none; }
.ct-viewport canvas { max-width:100%; cursor:default; }
#ct-body canvas { display:block; width:100%; height:100%; }
#ct-slice canvas, #ct-ultrasound canvas { display:block; width:100%; height:100%; object-fit:contain; cursor:crosshair; }
#ct-slice, #ct-ultrasound { background:#000; }
/* Under the B-mode: the overlay slider on one line, the three display choices on the next. */
.ct-image-tools { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:8px 11px; background:#fafafa; border-top:1px solid var(--line,#dddddd); }
:is(.ct-image-tools,.ct-pair-tools) .ct-sliders { flex:1 1 100%; margin-bottom:2px; }
:is(.ct-image-tools,.ct-pair-tools) .ct-slider { display:flex; align-items:center; gap:10px; }
:is(.ct-image-tools,.ct-pair-tools) .ct-slider-heading { display:contents; }
:is(.ct-image-tools,.ct-pair-tools) .ct-slider-row { flex:1; min-width:0; max-width:320px; }
:is(.ct-image-tools,.ct-pair-tools) .ct-slider output { order:1; min-width:36px; font-size:12px; }
.ct-lab .ct-point, .ct-lab .ct-flow-note { flex:1 1 100%; margin:0 0 4px; font-size:12px; line-height:1.4; color:#484848; }
.ct-flow-red { color:#a3321f; font-weight:600; }
.ct-flow-blue { color:#2a45b0; font-weight:600; }
/* The pulsed-wave trace sits directly under the B-mode, like a scanner's duplex screen. */
.ct-pw { border-bottom:1px solid #dfdfdf; }
.ct-pw canvas { display:block; width:100%; background:#101113; }
#ct-spectrum { height:130px; border-top:1px solid #2a2e33; }
#ct-ecg { height:36px; border-top:1px solid #2a2e33; }
.ct-lab .ct-pw-readout, .ct-lab .ct-pw-note { margin:0; padding:8px 10px 0; font-size:12px; line-height:1.4; color:#484848; }
.ct-pw-readout strong { color:#1d1d1d; }
.ct-lab .ct-pw-note { padding-bottom:8px; color:#5e5e5e; }
.ct-pw-vessels { padding:6px 10px 0; align-items:center; font-size:12px; }
.ct-pw-vessels span { font-weight:700; margin-right:2px; }
.ct-pw-pattern { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:6px 10px 0; font-size:12px; }
.ct-lab .ct-pw-pattern label { margin:0; font-size:12px; }
/* The shared site select, sized to its text so it sits beside its label. */
.ct-lab .ct-pw-pattern select { width:auto; max-width:100%; min-height:44px; margin:0; padding-block:8px; font-size:13px; }
.ct-lab .ct-pw-pattern select:focus-visible { outline:3px solid #4c7a9e; outline-offset:2px; }
.ct-lab .ct-check { position:relative; min-height:44px; display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid var(--line-strong,#c2c2c2); border-radius:6px; background:var(--paper,#fff); color:var(--ink,#1d1d1d); font-size:12.5px; font-weight:600; line-height:1.2; cursor:pointer; user-select:none; transition:background-color .12s ease,border-color .12s ease; }
.ct-lab .ct-check::before { content:""; width:7px; height:7px; border-radius:999px; border:1.5px solid #959595; background:transparent; flex:none; }
@media(hover:hover) { .ct-lab .ct-check:hover:not(:has(input:disabled)):not(:has(input:checked)) { border-color:var(--accent,#8b6826); background:#fafafa; } }
.ct-lab .ct-check:has(input:checked) { background:var(--accent-soft,#fbf6e8); border-color:var(--accent,#8b6826); box-shadow:inset 0 0 0 1px var(--accent,#8b6826); color:var(--ink,#1d1d1d); font-weight:700; }
.ct-lab .ct-check:has(input:checked)::before { border-color:var(--accent,#8b6826); background:var(--accent,#8b6826); box-shadow:0 0 0 2px rgba(139,104,38,.18); }
.ct-lab .ct-check:has(input:focus-visible) { outline:3px solid #4c7a9e; outline-offset:2px; }
.ct-lab .ct-check:has(input:disabled) { opacity:.5; cursor:default; }
.ct-lab .ct-check input { position:absolute; inset:-1px; width:calc(100% + 2px); height:calc(100% + 2px); margin:0; opacity:0; cursor:pointer; }
.ct-lab .ct-check input:disabled { cursor:default; }
.ct-lab .ct-depth { min-height:44px; display:flex; align-items:center; gap:6px; font-size:13px; }
.ct-lab .ct-depth label { margin:0; font-size:13px; white-space:nowrap; }
.ct-lab .ct-depth select { width:auto; min-height:44px; margin:0; padding-block:8px; font-size:13px; border-radius:6px; }
.ct-lab .ct-depth select:focus-visible { outline:3px solid #4c7a9e; outline-offset:2px; }
.ct-point strong { color:#1d1d1d; }
/* One row of camera controls: four small steps, then the two named views. */
.ct-camera { padding:6px 8px; gap:4px; }
.ct-camera button { flex:1 0 40px; min-width:40px; padding:4px; }
.ct-camera .icon { width:18px; height:18px; }
.ct-camera #ct-camera-face, .ct-camera #ct-camera-reset { flex:2 0 72px; padding:4px 6px; font-size:12px; }
.ct-body-actions { padding:0 8px 8px; align-items:center; flex-wrap:nowrap; }
.ct-body-actions button { flex:0 0 auto; }
.ct-lab .ct-body-actions p { margin:0; font-size:12px; line-height:1.35; color:#5e5e5e; }
.ct-body-opacity { padding:0 8px 8px; }
.ct-cross-section { grid-area:ct; }
.ct-bmode { grid-area:ultrasound; }
.ct-overview { grid-area:anatomy; }
.ct-selection-panel { grid-area:selection; border:1px solid var(--line,#dddddd); border-radius:10px; box-shadow:0 1px 3px rgba(21,21,21,.04); padding:11px 12px; background:var(--paper,#fff); }
.ct-selection-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; }
.ct-selection-heading #ct-clear { font-size:12px; min-height:36px; }
[data-ct-structures] { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
[data-ct-structures] button { min-width:44px; font-size:12px; }
.ct-lab #ct-selection { margin:8px 0 0; font-size:12px; }
.ct-lab #ct-show-3d { margin-top:6px; }
.ct-lab .ct-method { margin-top:16px; font-size:13px; padding:0; }
.ct-method summary { cursor:pointer; font-weight:700; padding:10px 0; }
.ct-small { font-size:13px; }
@media(min-width:761px) {
 /* Move probe and Body visibility share a row under the camera controls. */
 .ct-overview { display:grid; grid-template-columns:max-content minmax(0,1fr); align-items:center; }
 .ct-overview > * { grid-column:1 / -1; }
 .ct-overview > .ct-body-actions { display:contents; }
 .ct-overview #ct-move-probe { grid-column:1; grid-row:4; margin:0 0 6px 8px; }
 .ct-overview > .ct-body-opacity { grid-column:2; grid-row:4; padding:0 8px 6px 12px; }
 .ct-overview #ct-move-note { grid-column:1 / -1; grid-row:5; padding:0 8px 8px; }
 /* The hint is needed once placing by pointer is on; until then the button says enough. */
 .ct-overview #ct-move-probe:not([aria-pressed=true]) + #ct-move-note { display:none; }
}
@media(min-width:761px) {
 /* On a short, wide screen (a phone on its side) the main image letterboxes instead of running off the bottom. */
 .ct-bmode .ct-viewport { width:100%; max-height:max(260px, 100vh - 150px); max-height:max(260px, 100dvh - 150px); }
 /* A pair: the B-mode and one other view side by side at the same size, with the probe controls beside them. */
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace { grid-template-columns:var(--ct-rail, 240px) repeat(2,minmax(0,1fr)); grid-template-rows:min-content 1fr; }
 .ct-lab[data-mobile-view=pair3d] .ct-workspace { grid-template-areas:"controls ultrasound anatomy" "controls selection anatomy"; }
 .ct-lab[data-mobile-view=compare] .ct-workspace { grid-template-areas:"controls ultrasound ct" "controls selection ct"; }
 .ct-lab[data-mobile-view=pair3d] .ct-cross-section, .ct-lab[data-mobile-view=compare] .ct-overview { display:none; }
 .ct-lab[data-mobile-view=pair3d] .ct-overview .ct-viewport, .ct-lab[data-mobile-view=compare] .ct-cross-section .ct-viewport { width:100%; height:auto; aspect-ratio:4/3; max-height:max(260px, 100vh - 150px); max-height:max(260px, 100dvh - 150px); }
 /* Each caption keeps to one line, cutting its note short if it must, so the two pictures start level. */
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace figcaption { flex-wrap:nowrap; white-space:nowrap; }
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace figcaption span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
 /* A figure stretched beside a taller B-mode keeps its rows at the top. */
 .ct-overview { align-content:start; }
}
@media(min-width:1041px) {
 /* The site header scrolls away at this width, so a pinned image sits at the very top of the screen. */
 .ct-lab { --ct-pin:0px; }
 /* Keep the simulator page's header compact on wide screens so the scan and its controls fit above the fold. */
 body:has(.sim-intro) .site-header .header-nav { padding-block:18px 14px; }
 body:has(.sim-intro) .site-header .header-brand img { height:84px; }
}
@media(min-width:761px) {
 .site-main:has(.sim-intro) { padding-top:8px; }
 .container:has(> .sim-intro) { padding-top:10px; }
 .sim-intro .page-heading { margin-bottom:8px; }
 .sim-intro .page-heading h1 { font-size:30px; margin-bottom:2px; }
 .sim-intro .lede { font-size:15px; line-height:1.45; }
 .sim-explorer-tabs { margin:10px 0; }
 .sim-explorer-tabs a { padding:9px 16px; }
}
@media(min-width:761px) and (min-height:520px) {
 /* With the PW gate on, the B-mode and its trace stay pinned while the gate's controls and the display
    options scroll under them. On a short screen the image gives up height, so 150px stays free for those. */
 /* The PW panel's parts join the figure, so the trace stays pinned for exactly as long as the B-mode above it;
    left inside the panel it would stop at the panel's end and ride up over the image. */
 .ct-bmode .ct-pw { display:contents; }
 .ct-bmode .ct-pw-note { border-bottom:1px solid #dfdfdf; }
 .ct-lab:has(#ct-pw-panel:not([hidden])) .ct-bmode .ct-viewport { position:sticky; top:var(--ct-pin); z-index:2; max-height:max(200px, var(--ct-vh) - var(--ct-pin) - 280px); }
 .ct-lab:has(#ct-pw-panel:not([hidden])) #ct-spectrum { position:sticky; top:calc(var(--ct-pin) + var(--ct-bmode-h, 0px)); z-index:2; }
 /* At the figure's end the two leave together: the B-mode keeps room under it for the trace, which the trace
    takes back, so nothing moves and the trace never slides up over the image. */
 .ct-lab:has(#ct-pw-panel:not([hidden])) .ct-bmode #ct-ultrasound { margin-bottom:var(--ct-trace-h, 0px); }
 .ct-lab:has(#ct-pw-panel:not([hidden])) .ct-bmode #ct-spectrum { margin-top:calc(-1 * var(--ct-trace-h, 0px)); }
 .ct-lab:has(#ct-pw-panel:not([hidden])) .ct-bmode :is(button, input, select) { scroll-margin-top:calc(var(--ct-bmode-h, 0px) + var(--ct-trace-h, 0px) + var(--ct-clear)); }
 /* In a pair the other view's whole figure stays pinned beside the B-mode while the gate's controls scroll:
    the view at the B-mode's height, and with it the 3D camera buttons, Move probe and Body visibility, so
    none of them slides under the picture. */
 .ct-lab[data-mobile-view=pair3d]:has(#ct-pw-panel:not([hidden])) .ct-overview,
 .ct-lab[data-mobile-view=compare]:has(#ct-pw-panel:not([hidden])) .ct-cross-section { position:sticky; top:var(--ct-pin); z-index:2; }
 .ct-lab[data-mobile-view=pair3d]:has(#ct-pw-panel:not([hidden])) .ct-overview .ct-viewport,
 .ct-lab[data-mobile-view=compare]:has(#ct-pw-panel:not([hidden])) .ct-cross-section .ct-viewport { max-height:max(200px, var(--ct-vh) - var(--ct-pin) - 280px); }
}
@media(min-width:1051px) {
 /* The 3D view and CT section share what a short screen leaves under the tabs
    and heading (135px) once their captions and the 3D controls (192px) are
    placed: the CT section takes up to 57% of it, the 3D view the rest. */
 .ct-lab { --ct-room:calc(var(--ct-vh) - 327px); }
 .ct-overview .ct-viewport { height:clamp(150px, var(--ct-room) - min(260px, var(--ct-room) * .57), 270px); }
 .ct-cross-section .ct-viewport { width:100%; max-height:max(180px, var(--ct-room) * .57); }
}
@media(min-width:1051px) and (max-width:1207px) {
 /* In a column this narrow the camera buttons and the 3D caption each take a second line (65px). */
 .ct-lab { --ct-room:calc(var(--ct-vh) - 392px); }
}
@media(max-width:1050px) {
 .ct-lab { --ct-rail:220px; }
 .ct-workspace { grid-template-columns:220px repeat(2,minmax(0,1fr)); grid-template-areas:"controls ultrasound ultrasound" "controls anatomy ct" "controls selection selection"; grid-template-rows:min-content min-content 1fr; }
 .ct-overview .ct-viewport { height:240px; }
 .ct-lab #ct-status { margin-left:0; flex-basis:100%; }
 /* Tablets and phones are touched, so the small disclosure rows and slider steps grow to a full target. */
 .ct-probe-help summary, .ct-selection-heading #ct-clear { min-height:44px; }
 .ct-slider-row button { flex:0 0 44px; min-width:44px; }
}
@media(max-width:760px) {
 /* A phone's first screen is for the picture: the page starts close under the site header, and the
    one-line description is left to screen readers. */
 .site-main:has(.sim-intro) { padding-top:8px; }
 .container:has(> .sim-intro) { padding-top:8px; }
 .sim-intro .page-heading { margin-bottom:6px; }
 .sim-intro .page-heading h1 { font-size:24px; margin:0; }
 .sim-intro .lede { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 .sim-explorer-tabs { margin:8px 0; }
 .sim-explorer-tabs a { flex:1; padding:8px; text-align:center; }
 .ct-heading { gap:4px 10px; margin-bottom:8px; }
 .ct-lab .ct-heading h2 { font-size:18px; }
 /* The picker takes its own line under the status; the longer names get the wider buttons. */
 .ct-view-picker { order:1; flex:1 1 100%; flex-wrap:nowrap; gap:3px; padding:3px; background:#eeeeee; border:1px solid #d4d4d4; border-radius:8px; margin-bottom:2px; }
 .ct-view-picker button { flex:1 1 auto; padding-inline:4px; border-radius:6px; font-size:12px; }
 .ct-view-picker [data-ct-view=all] { display:none; }
 .ct-view-picker :is([data-ct-view=ultrasound], [data-ct-view=ct], [data-ct-view="3d"]) { display:inline-block; }
 /* One view at a time. Its parts join a single column, so the image can stay
    pinned under the site header while the controls scroll beneath it. */
 .ct-workspace { display:flex; flex-direction:column; gap:0; align-items:stretch; }
 .ct-lab[data-mobile-view=ultrasound] .ct-bmode,
 .ct-lab[data-mobile-view=ct] .ct-cross-section,
 .ct-lab[data-mobile-view="3d"] .ct-overview { display:contents; }
 .ct-lab:not([data-mobile-view=ct], [data-mobile-view=compare]) .ct-cross-section,
 .ct-lab:not([data-mobile-view=ultrasound], [data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-bmode,
 .ct-lab:not([data-mobile-view="3d"], [data-mobile-view=pair3d]) .ct-overview { display:none; }
 .ct-workspace figcaption { padding:2px 2px 6px; font-size:13px; }
 .ct-workspace figcaption span { font-size:12px; }
 .ct-workspace .ct-viewport { height:auto; aspect-ratio:4/3; border-radius:8px; }
 .ct-image-tools { background:#fafafa; border:1px solid #d1d1d1; border-radius:8px; margin-top:8px; padding:8px; gap:6px; }
 /* The PW panel's parts join the column, so its trace can pin under the image. */
 .ct-pw { display:contents; }
 .ct-pw > #ct-spectrum { margin-top:6px; }
 .ct-image-tools .ct-check { flex:1 1 auto; justify-content:center; padding:6px 8px; font-size:12px; }
 .ct-image-tools .ct-depth { flex:1 1 150px; justify-content:space-between; }
 .ct-image-tools .ct-depth select { flex:1 1 auto; max-width:140px; }
 .ct-camera { padding:8px 0 0; }
 .ct-body-actions { padding:8px 0 0; }
 .ct-sliders.ct-body-opacity { padding:8px 0 0; grid-template-columns:1fr; }
 .ct-lab fieldset { margin-top:10px; padding:8px 10px; }
 .ct-selection-panel { margin-top:10px; }
 /* A pair keeps both views side by side, each in its own frame, the ultrasound on the right. */
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-areas:"ct ultrasound" "tools tools" "controls controls" "selection selection"; gap:0 6px; }
 .ct-lab[data-mobile-view=pair3d] .ct-workspace { grid-template-areas:"anatomy ultrasound" "tools tools" "controls controls" "selection selection"; }
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace figcaption { padding:4px 6px; }
 /* Titles only, so the two half-width images start at the same height. */
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace figcaption span { display:none; }
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace .ct-viewport { border-radius:0; }
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) :is(.ct-image-tools, .ct-pw) { display:none; }
 /* The pair keeps two large touch controls under the images. */
 .ct-lab[data-mobile-view=pair3d] :is(.ct-camera, .ct-body-opacity) { display:none; }
 .ct-lab[data-mobile-view=pair3d] .ct-body-hud { inset:5px 6px auto; font-size:10px; }
 #ct-spectrum { height:110px; }
 .ct-sliders { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px; }
 :is(.ct-image-tools,.ct-pair-tools) .ct-sliders { grid-template-columns:1fr; }
 .ct-probe-actions { margin-top:4px; }
 .ct-probe-help { margin-top:8px; }
 .ct-probe-options { display:flex; flex-wrap:wrap; gap:0 8px; }
 .ct-probe-options>.ct-probe-help { flex:1; min-width:0; }
 .ct-probe-options>.ct-probe-help[open] { flex-basis:100%; }
 .ct-probe-options summary { font-size:12px; }
}
@media(max-width:760px) and (min-height:420px) {
 /* The image stays pinned. On a short screen its box keeps the full width and loses
    height, with the picture fitted inside, so 230px stays free for the controls under
    it and nothing shows beside it. Sizes come from the screen alone; the script
    measures what is pinned (--ct-image-h, --ct-bmode-h, --ct-trace-h) for offsets and scroll margins. */
 .ct-lab:not([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace .ct-viewport { position:sticky; top:var(--ct-pin); z-index:2; width:100%; max-height:max(150px, var(--ct-vh) - var(--ct-pin) - 230px); box-shadow:0 6px 14px rgba(10,12,16,.18); }
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace > figure { position:sticky; top:var(--ct-pin); z-index:2; box-shadow:0 6px 14px rgba(10,12,16,.14); }
 /* The explicit width keeps a height limit from narrowing the box through its aspect ratio. */
 .ct-lab:is([data-mobile-view=compare], [data-mobile-view=pair3d]) .ct-workspace .ct-viewport { width:100%; max-height:max(120px, var(--ct-vh) - var(--ct-pin) - 260px); }
 /* A control brought into view by focus stops below what is pinned. */
 .ct-lab :is(button, input, select, summary) { scroll-margin-top:calc(var(--ct-image-h, 0px) + var(--ct-trace-h, 0px) + var(--ct-clear)); }
}
@media(max-width:760px) and (min-height:480px) {
 /* With the PW gate on, the 110px trace stays under the B-mode while the probe moves, and takes its share of the room. */
 .ct-lab[data-mobile-view=ultrasound] #ct-spectrum { position:sticky; top:calc(var(--ct-pin) + var(--ct-image-h, 0px)); z-index:2; margin-top:0; }
 /* The two leave the screen together at the workspace's end, as on wider screens. */
 .ct-lab[data-mobile-view=ultrasound]:has(#ct-pw-panel:not([hidden])) #ct-ultrasound { margin-bottom:var(--ct-trace-h, 0px); }
 .ct-lab[data-mobile-view=ultrasound]:has(#ct-pw-panel:not([hidden])) #ct-spectrum { margin-top:calc(-1 * var(--ct-trace-h, 0px)); }
 .ct-lab[data-mobile-view=ultrasound]:has(#ct-pw-panel:not([hidden])) .ct-workspace .ct-viewport { max-height:max(150px, var(--ct-vh) - var(--ct-pin) - 340px); }
}
@media(max-width:736px) {
 .ct-lab { --ct-pin:60px; }
}
@media(pointer:coarse) {
 /* iPhone Safari zooms the whole page when a field with text under 16px takes focus. */
 .ct-lab .ct-pw-pattern select, .ct-lab .ct-depth select { font-size:16px; }
 /* A touch screen at desktop width (a tablet on its side) gets the same full-size targets. */
 .ct-probe-help summary, .ct-selection-heading #ct-clear { min-height:44px; }
 .ct-slider-row button { flex:0 0 44px; min-width:44px; }
 /* A slider is grabbed by its whole row height, not only the thin track. */
 .ct-sliders input { height:44px; }
 /* A finger on the probe turns the body like any other drag; touch places the probe with Move probe on. */
 .ct-mouse-only { display:none; }
}

/* Full screen. On a phone, or any screen too short for the views to be read beside their controls, each view's
   caption has an expand button. It fills the screen with that view, or with both views of the pair it is in:
   stacked when the screen is upright, side by side when it is turned. A bar of probe steps stays under them. */
.ct-expand, .ct-full-bar, .ct-full-probe, .ct-label-short { display:none; }
.ct-pair-tools { grid-area:tools; display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:6px; }
.ct-pair-tools .ct-overlay { flex:1 1 100%; grid-template-columns:minmax(0,1fr); padding:4px 10px; background:#fff; border:1px solid #d1d1d1; border-radius:6px; }
.ct-pair-tools .ct-contrast { flex:1 1 180px; justify-content:space-between; padding:2px 10px; background:#fff; border:1px solid #d1d1d1; border-radius:6px; }
.ct-pair-tools .ct-contrast select { flex:1 1 auto; max-width:155px; }
.ct-pair-tools .ct-overlay input { height:44px; }
.ct-pair-tools .ct-body-actions { padding:0; }
.ct-pair-tools #ct-move-note { display:none; }
.ct-pair-tools button { flex:1 1 auto; padding-inline:8px; font-size:12px; }
.ct-pair-tools .ct-check { flex:0 0 auto; padding-inline:9px; font-size:12px; }
@media (max-width:760px), (max-height:520px) {
 .ct-lab .ct-workspace figcaption { align-items:center; }
 .ct-lab .ct-expand { display:inline-flex; align-items:center; justify-content:center; flex:none; margin-left:auto; min-width:44px; min-height:44px; padding:4px 10px; }
 .ct-expand .icon { width:20px; height:20px; }
}
html:has(#ct-lab[data-expanded]), html:has(#ct-lab[data-expanded]) body { overflow:hidden; }
/* The full-screen layer wins over every pinned and paired layout rule, hence the !important flags. It is a dark
   scanner console: the pictures, then the view's own controls, then the probe controls. */
#ct-lab[data-expanded] .ct-workspace { --fs-surface:#161a1f; --fs-line:#2b3139; --fs-ink:#e8e8e8; --fs-muted:#a1a6ad; --fs-accent:#e3b95f;
  position:fixed !important; inset:0; z-index:1000; margin:0; display:grid !important; gap:8px;
  padding:max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background:#0b0d10; color:var(--fs-ink); overscroll-behavior:contain; align-items:stretch !important; justify-items:stretch !important;
  grid-template-columns:minmax(0,1fr) !important; grid-template-rows:auto minmax(0,1fr) auto auto !important; grid-template-areas:"bar" "a" "tools" "probe" !important; }
#ct-lab:is([data-expanded=compare], [data-expanded=pair3d]) .ct-workspace { grid-template-rows:auto minmax(0,1fr) minmax(0,1fr) auto auto !important; grid-template-areas:"bar" "a" "b" "tools" "probe" !important; }
#ct-lab[data-expanded] .ct-workspace > :is(fieldset, figure, .ct-selection-panel) { display:none !important; }
#ct-lab[data-expanded] .ct-full-bar { display:flex; grid-area:bar; align-items:center; justify-content:space-between; gap:12px; min-width:0; }
#ct-lab[data-expanded] .ct-full-bar strong { font-size:15px; line-height:1.25; letter-spacing:-.005em; }
#ct-lab[data-expanded] .ct-full-heading { display:flex; flex-direction:column; min-width:0; padding-left:2px; }
#ct-lab[data-expanded] #ct-full-where { font-size:12px; line-height:1.3; color:var(--fs-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Every control on the layer is drawn for the dark ground; the page's light buttons would glare beside the scan. */
#ct-lab[data-expanded] .ct-workspace :is(.ct-full-bar, .ct-pair-tools, .ct-full-probe) button { background:var(--fs-surface); border:1px solid var(--fs-line); border-radius:8px; box-shadow:none; color:var(--fs-ink); font-size:13px; font-weight:600; }
#ct-lab[data-expanded] .ct-workspace :is(.ct-full-bar, .ct-pair-tools, .ct-full-probe) button:active:not(:disabled) { background:#222830; }
#ct-lab[data-expanded] .ct-workspace :is(.ct-full-bar, .ct-pair-tools, .ct-full-probe) button:disabled { opacity:.36; }
#ct-lab[data-expanded] .ct-workspace :is(.ct-pair-tools, .ct-full-probe) button[aria-pressed=true] { background:rgba(227,185,95,.14); border-color:var(--fs-accent); color:#f4d994; }
#ct-lab[data-expanded] .ct-workspace :is(button, input, select):focus-visible, #ct-lab[data-expanded] .ct-check:has(input:focus-visible) { outline:2px solid #9cc4e4; outline-offset:2px; }
#ct-lab[data-expanded] #ct-full-close { display:inline-flex; align-items:center; gap:6px; flex:none; padding:8px 12px 8px 10px; background:transparent; }
#ct-full-close .icon { width:18px; height:18px; }
/* The probe: the four starting windows, then slide and turn as − name + steppers, then the quarter turn. */
#ct-lab[data-expanded] .ct-full-probe { display:grid; grid-area:probe; gap:8px; min-width:0; }
.ct-full-windows { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; padding:3px; background:#101317; border:1px solid var(--fs-line); border-radius:10px; }
#ct-lab[data-expanded] .ct-workspace .ct-full-windows button { min-height:40px; padding:4px 2px; border-color:transparent; border-radius:7px; background:transparent; color:var(--fs-muted); font-size:12.5px; }
#ct-lab[data-expanded] .ct-workspace .ct-full-windows button[aria-pressed=true] { background:#262c34; border-color:transparent; color:#f4d994; }
.ct-full-steps { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:8px; }
.ct-stepper { display:flex; align-items:stretch; min-width:0; overflow:hidden; background:var(--fs-surface); border:1px solid var(--fs-line); border-radius:8px; }
.ct-stepper span { flex:1 1 0; min-width:0; display:grid; place-items:center; border-inline:1px solid var(--fs-line); color:var(--fs-muted); font-size:12.5px; font-weight:600; }
#ct-lab[data-expanded] .ct-workspace .ct-stepper button { flex:0 0 46px; min-width:0; padding:0; border:0; border-radius:0; background:transparent; font-size:20px; font-weight:500; line-height:1; }
#ct-lab[data-expanded] .ct-workspace .ct-full-quarter { padding-inline:14px; white-space:nowrap; }
/* The view's own controls: the page's buttons, checks and selects, moved here and drawn dark. */
#ct-lab[data-expanded] .ct-pair-tools { grid-area:tools; gap:8px; margin:0; min-width:0; }
#ct-lab[data-expanded] .ct-pair-tools .ct-body-actions { display:contents; }
#ct-lab[data-expanded] .ct-pair-tools :is(.ct-check, .ct-depth, .ct-overlay) { background:var(--fs-surface); border:1px solid var(--fs-line); border-radius:8px; color:var(--fs-ink); }
#ct-lab[data-expanded] .ct-pair-tools .ct-check { flex:1 1 auto; justify-content:center; font-size:13px; }
#ct-lab[data-expanded] .ct-pair-tools .ct-check::before { border-color:#7d848d; }
#ct-lab[data-expanded] .ct-pair-tools .ct-check:has(input:checked) { background:rgba(227,185,95,.14); border-color:var(--fs-accent); box-shadow:none; color:#f4d994; }
#ct-lab[data-expanded] .ct-pair-tools .ct-check:has(input:checked)::before { background:var(--fs-accent); border-color:var(--fs-accent); box-shadow:none; }
/* Full screen says Labels: the row is short, and the pictures beside it show what is labelled. */
#ct-lab[data-expanded] .ct-label-long { display:none; }
#ct-lab[data-expanded] .ct-label-short { display:inline; }
#ct-lab[data-expanded] .ct-pair-tools .ct-depth { flex:1 1 130px; justify-content:space-between; padding:0 2px 0 12px; }
#ct-lab[data-expanded] .ct-pair-tools .ct-depth label { color:var(--fs-muted); font-weight:600; }
/* 16px, or iPhone Safari zooms the layer when the select takes focus, at any width. */
#ct-lab[data-expanded] .ct-pair-tools .ct-depth select { flex:0 1 auto; max-width:none; min-height:42px; border:0; background-color:transparent; color:var(--fs-ink); font-size:16px; }
#ct-lab[data-expanded] .ct-pair-tools .ct-overlay { padding:0 12px; }
#ct-lab[data-expanded] .ct-pair-tools .ct-overlay label { color:var(--fs-muted); white-space:nowrap; }
#ct-lab[data-expanded] .ct-pair-tools .ct-overlay output { color:var(--fs-ink); }
#ct-lab[data-expanded] .ct-pair-tools .ct-overlay input { accent-color:var(--fs-accent); }
#ct-lab[data-expanded] .ct-pair-tools .ct-overlay .ct-slider-row { max-width:none; }
/* The chosen views: each picture fills what the screen leaves. One view needs no caption, the bar names it. */
#ct-lab:is([data-expanded=ultrasound], [data-expanded=compare], [data-expanded=pair3d]) .ct-workspace > .ct-bmode,
#ct-lab:is([data-expanded=ct], [data-expanded=compare]) .ct-workspace > .ct-cross-section,
#ct-lab:is([data-expanded="3d"], [data-expanded=pair3d]) .ct-workspace > .ct-overview {
  display:flex !important; flex-direction:column; align-items:stretch !important; grid-area:a !important; min-width:0; min-height:0; margin:0;
  position:static !important; border:0; border-radius:0; box-shadow:none; background:transparent; overflow:hidden; }
#ct-lab:is([data-expanded=compare], [data-expanded=pair3d]) .ct-workspace > .ct-bmode { grid-area:b !important; }
#ct-lab[data-expanded] .ct-workspace > figure > :not(figcaption, .ct-viewport) { display:none !important; }
#ct-lab[data-expanded] .ct-workspace figcaption { display:none !important; }
#ct-lab:is([data-expanded=compare], [data-expanded=pair3d]) .ct-workspace figcaption { display:block !important; padding:0 2px 5px; border:0; background:transparent; color:var(--fs-muted); font-size:11px; line-height:1.2; letter-spacing:.07em; text-transform:uppercase; }
#ct-lab[data-expanded] .ct-workspace figcaption strong { font-weight:600; }
#ct-lab[data-expanded] .ct-workspace figcaption :is(span, .ct-expand) { display:none !important; }
#ct-lab[data-expanded] .ct-workspace .ct-viewport { flex:1 1 auto; width:100% !important; height:auto !important; min-height:0; max-height:none !important;
  aspect-ratio:auto !important; margin:0 !important; inset:auto !important; position:relative !important; border:1px solid #1d2228; border-radius:8px !important; box-shadow:none !important; }
/* Turned sideways, the controls stand in a rail beside the pictures, which keep the screen's whole height. */
@media (orientation:landscape) {
 #ct-lab[data-expanded] .ct-workspace { grid-template-columns:minmax(0,1fr) 272px !important; grid-template-rows:auto auto minmax(0,1fr) !important; grid-template-areas:"a bar" "a probe" "a tools" !important; }
 #ct-lab:is([data-expanded=compare], [data-expanded=pair3d]) .ct-workspace { grid-template-columns:repeat(2,minmax(0,1fr)) 272px !important; grid-template-rows:auto auto minmax(0,1fr) !important; grid-template-areas:"a b bar" "a b probe" "a b tools" !important; }
 #ct-lab[data-expanded] .ct-pair-tools { align-self:start; }
 /* The rail is narrow, so the line that says where the probe is may take two lines instead of being cut short. */
 #ct-lab[data-expanded] #ct-full-where { white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
 /* The four windows stay on one line, each as wide as its name. */
 .ct-full-windows { display:flex; }
 #ct-lab[data-expanded] .ct-workspace .ct-full-windows button { flex:1 1 auto; padding-inline:5px; font-size:12px; }
 /* The select's values name the CT window, so its label is left to screen readers and the row stays on one line. */
 #ct-lab[data-expanded] .ct-pair-tools .ct-contrast label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 #ct-lab[data-expanded] .ct-pair-tools .ct-contrast { flex:1 1 120px; padding-left:2px; }
 .ct-full-steps { grid-template-columns:minmax(0,1fr) auto; }
 .ct-stepper[data-ct-stepper=slide] { grid-column:1 / -1; }
}
@media (orientation:landscape) and (min-width:761px) {
 /* The pair keeps the page's order: at this width the B-mode sits on the left, beside the probe controls. */
 #ct-lab:is([data-expanded=compare], [data-expanded=pair3d]) .ct-workspace { grid-template-areas:"b a bar" "b a probe" "b a tools" !important; }
}
@media (orientation:landscape) and (max-height:359px) {
 /* The shortest phones: every row gives up a little so the rail still ends above the screen's edge. */
 #ct-lab[data-expanded] .ct-workspace { gap:6px; }
 #ct-lab[data-expanded] .ct-full-probe { gap:6px; }
 #ct-lab[data-expanded] .ct-workspace :is(.ct-pair-tools, .ct-full-probe) :is(button, .ct-check, .ct-depth) { min-height:40px; }
 #ct-lab[data-expanded] .ct-workspace .ct-full-probe .ct-full-windows button { min-height:36px; }
 #ct-lab[data-expanded] .ct-pair-tools .ct-depth select { min-height:38px; }
 #ct-lab[data-expanded] .ct-pair-tools .ct-overlay input { height:38px; }
}
@media (max-width:350px) {
 /* The narrowest phones: the steppers' − and + give up a little width so the name between them is not crowded. */
 #ct-lab[data-expanded] .ct-workspace .ct-stepper button { flex-basis:38px; }
 #ct-lab[data-expanded] .ct-workspace .ct-full-quarter { padding-inline:8px; }
 .ct-full-steps { gap:6px; }
}
@media (orientation:portrait) and (max-height:700px) {
 /* A short upright screen gives the pair its room: the bar already names both views, and the CT overlay is the
    one control the comparison keeps. */
 #ct-lab:is([data-expanded=compare], [data-expanded=pair3d]) .ct-workspace figcaption { display:none !important; }
 #ct-lab[data-expanded=compare] .ct-pair-tools :is(.ct-check, .ct-contrast) { display:none; }
}
/* Drags turn the 3D body and taps mark spots; none of them scrolls the page under the full-screen layer. */
#ct-lab[data-expanded] .ct-workspace :is(.ct-viewport, .ct-viewport canvas) { touch-action:none !important; }
