/* One image at a time; panels never change the image's measurement coordinates. */
.workspace.hidden { display: none; }
.study-only { display: none; }
body.study-mode { padding: 10px; padding-bottom: 70px; background: #e9eef5; }
body.study-mode .container { max-width: none; }
body.study-mode .study-only { display: flex; }
body.study-mode #appShell > .card:first-child { padding: 10px 14px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
body.study-mode #appShell > .card:first-child > .row,
body.study-mode #appShell > .card:first-child .top-actions .muted { display: none; }
body.study-mode #appShell h1 { font-size: 20px; margin: 0; white-space: nowrap; }
body.study-mode #appShell > .card:first-child .top-actions { gap: 20px; margin: 0; }
body.study-mode #progressBox { margin: 0; padding: 0; background: transparent; border: 0; flex: 1; max-width: 540px; }
body.study-mode #progressBox > div:first-child, body.study-mode #progressBox .progress-bar { display: none !important; }
body.study-mode #progressBox .progress-grid { margin: 0; gap: 8px; }
body.study-mode #progressBox .progress-item { padding: 4px 8px; display: flex; align-items: center; gap: 7px; }
body.study-mode #progressBox .progress-number { font-size: 18px; }
body.study-mode #progressBox .progress-label { font-size: 10px; }
body.study-mode #caseBox { padding: 9px 14px; margin-bottom: 8px; box-shadow: none; background: transparent; }
body.study-mode #caseBox h2 { font-size: 15px; margin: 0 0 4px; }
body.study-mode #caseMeta { font-size: 12px; }
body.study-mode #caseBox > div:last-child { display: none !important; }
body.study-mode #statusBox { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); z-index: 65; width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; margin: 0; font-size: 13px; pointer-events: none; }
body.study-mode .workspace { position: relative; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; height: calc(100dvh - 196px); min-height: 440px; align-items: stretch; }
body.study-mode.study-form-open .workspace { grid-template-columns: minmax(0,1fr) 380px; }
body.study-mode .workspace > *, body.study-mode .row > * { min-width: 0; }
body.study-mode .workspace > .card:first-child { display: flex; flex-direction: column; background: #111b2c; padding: 10px; margin: 0; min-height: 0; border: 1px solid #243349; box-shadow: 0 8px 24px #17203318; }
body.study-mode .workspace > .card:first-child > h3,
body.study-mode .workspace > .card:first-child > .toolbar,
body.study-mode #projectionHint, body.study-mode #dicomMeta { display: none; }
body.study-mode .assessment-panel { display: none; margin: 0; overflow-y: auto; padding: 16px; }
body.study-mode.study-form-open .assessment-panel { display: block; }
.assessment-panel-heading { justify-content: space-between; align-items: center; position: sticky; top: -16px; background: white; z-index: 2; padding: 10px 0; margin-bottom: 10px; border-bottom: 1px solid #e2e8f0; }
.assessment-panel-heading button { border: 0; background: #edf2f7; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
body.study-mode .assessment-panel .row { grid-template-columns: 1fr; gap: 4px; }
.study-view-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
#studyImageTabs { display: flex; gap: 6px; flex-wrap: wrap; }
#studyImageTabs button { padding: 9px 14px; border-radius: 8px; font-size: 13px; }
#studyImageTabs .btn-secondary { background: #22324b; color: #cbd5e1; border: 1px solid #354660; }
#studyImageTabs .btn { background: #2563eb; color: white; }
.study-view-actions { display: flex; gap: 6px; }
.study-view-actions button { padding: 8px 12px; background: #22324b; color: #e2e8f0; border: 1px solid #354660; border-radius: 8px; cursor: pointer; }
.study-view-actions button[aria-expanded="true"] { background: #2563eb; }
body.study-mode #studyViewNotice { background: none; border: 0; color: #a8b8cd; font-size: 12px; margin: 8px 2px; padding: 0; line-height: 1.4; }
body.study-mode #studyImageGrid { display: flex; flex: 1; min-height: 0; }
body.study-mode #dicomWrapper { flex: 1; min-height: 0; overflow: hidden; border-radius: 10px; background: #000; }
body.study-mode #dicomImage { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border-radius: 10px; }
body.study-mode #activeStudyLabel { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 3; color: #d9e5f5; background: #132139d9; border: 1px solid #33445c; border-radius: 20px; padding: 7px 14px; font-size: 12px; pointer-events: none; white-space: nowrap; }
.viewer-drawer-trigger { position: absolute; top: 12px; z-index: 42; border: 1px solid #415675; background: #17263deb; color: #edf4ff; padding: 10px 15px; border-radius: 9px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px #0004; }
#toolsDrawerToggle { left: 12px; } #measurementsDrawerToggle { right: 12px; }
.viewer-drawer-trigger[aria-expanded="true"] { background: #245acc; border-color: #6395fa; }
body.study-mode .dicom-side-tools, body.study-mode .measurement-side-panel { position: absolute; top: 60px; bottom: 52px; width: 258px; max-width: calc(100% - 24px); margin: 0; z-index: 40; display: flex; flex-direction: column; border-radius: 12px; background: #f8fafcf5; border: 1px solid #cbd5e1; box-shadow: 0 12px 40px #0007; transition: transform .2s ease, opacity .2s ease, visibility .2s; }
body.study-mode .dicom-side-tools { left: 12px; right: auto; }
body.study-mode .measurement-side-panel { right: 12px; left: auto; }
body.study-mode .dicom-side-tools.collapsed { transform: translateX(calc(-100% - 24px)); opacity: 0; visibility: hidden; pointer-events: none; }
body.study-mode .measurement-side-panel.collapsed { transform: translateX(calc(100% + 24px)); opacity: 0; visibility: hidden; pointer-events: none; }
body.study-mode .dicom-side-tools-body, body.study-mode .measurement-side-body { display: flex !important; flex-direction: column; gap: 7px; overflow-y: auto; max-height: none; min-height: 0; padding: 12px; }
body.study-mode .dicom-side-tools-header, body.study-mode .measurement-side-header { flex-shrink: 0; }
.study-contrast { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid #cbd5e1; }
.study-contrast label { margin: 4px 0; font-size: 12px; }
.study-contrast input { display: block; width: 100%; margin: 8px 0; accent-color: #2563eb; }
#viewerMeasurementHint { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(540px, calc(100% - 40px)); padding: 9px 12px; border-radius: 8px; color: #e0ecff; background: #162743e8; font-size: 12px; line-height: 1.4; z-index: 5; pointer-events: none; }
#viewerMeasurementHint:empty { display: none; }
body.study-mode .sticky-bar { padding: 8px 12px; background: #ffffffed; }
body.study-mode .sticky-inner { max-width: none; }
@media (max-width: 1000px) {
 body.study-mode #appShell > .card:first-child { flex-wrap: wrap; gap: 8px; }
 body.study-mode #progressBox { max-width: none; min-width: 100%; }
 body.study-mode .workspace { height: calc(100dvh - 222px); }
 body.study-mode.study-form-open .workspace { grid-template-columns: minmax(0,1fr); }
 body.study-mode.study-form-open .assessment-panel { position: absolute; inset: 0 0 0 auto; width: min(400px,100%); z-index: 55; box-shadow: -16px 0 50px #0007; }
}
@media (max-width: 600px) {
 body.study-mode { padding: 6px; padding-bottom: 78px; }
 body.study-mode .workspace { height: calc(100dvh - 245px); min-height: 400px; }
 body.study-mode #appShell > .card:first-child { padding: 8px; }
 body.study-mode #appShell > .card:first-child .top-actions { width: 100%; gap: 6px; }
 body.study-mode #progressBox .progress-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 2px; }
 body.study-mode #progressBox .progress-item { padding: 3px; flex-direction: column; gap: 0; }
 body.study-mode #progressBox .progress-label { font-size: 8px; }
 .study-view-heading { gap: 8px; } .study-view-actions { width: 100%; justify-content: flex-end; }
 #studyImageTabs button { padding: 7px 10px; }
 .viewer-drawer-trigger { padding: 9px 11px; }
 body.study-mode #activeStudyLabel { font-size: 11px; }
 body.study-mode .sticky-inner { gap: 8px; flex-wrap: nowrap; flex-direction: row; }
 body.study-mode .sticky-inner button { width: auto; flex: 1; font-size: 12px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { body.study-mode .dicom-side-tools, body.study-mode .measurement-side-panel { transition: none; } }
