.medical-studio{position:absolute;z-index:65;left:12px;right:12px;bottom:12px;height:min(43%,340px);min-height:220px;display:flex;flex-direction:column;gap:5px;padding:8px;border:1px solid var(--line,#526578);border-radius:8px;background:var(--panel,#182533);color:var(--text,#e4edf6);font:12px system-ui,sans-serif;box-shadow:0 8px 30px #0006;overflow:hidden;pointer-events:auto}.ms-head,.ms-tools,.ms-ruler{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.ms-head strong{color:inherit}.ms-head span{flex:1;opacity:.7}.medical-studio button,.medical-studio input,.medical-studio select{font:inherit;color:inherit;background:var(--panel,#26394a);border:1px solid var(--line,#577083);border-radius:4px;padding:4px;min-width:0}.medical-studio button{cursor:pointer}.medical-studio button:disabled{opacity:.45}.ms-body{display:grid;grid-template-columns:minmax(120px,22%) 1fr;gap:8px;min-height:0;flex:1}.ms-anatomy,.ms-timeline{display:flex;flex-direction:column;gap:5px;min-height:0;min-width:0}.ms-results,.ms-rows{overflow:auto;min-height:0;flex:1}.ms-results button{display:block;width:100%;text-align:left;margin-bottom:3px}.ms-ruler input{flex:1}.ms-row{display:grid;grid-template-columns:minmax(100px,23%) minmax(60px,1fr) auto;align-items:center;gap:4px;margin:3px 0;min-height:25px}.ms-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ms-track{height:20px;background:repeating-linear-gradient(90deg,#7990a019 0,#7990a019 1px,transparent 1px,transparent 10%);border:1px solid #69859b55;position:relative;border-radius:3px;cursor:crosshair}.ms-clip{position:absolute;top:2px;bottom:2px;border-radius:3px;pointer-events:none}.ms-fields{display:flex;gap:3px;align-items:center}.ms-fields input{width:52px}.ms-fields select{max-width:100px}.ms-status,.ms-hint{font-size:10px;opacity:.85}.ms-status{min-height:14px}.ms-rows{overflow-x:auto}.ms-row{min-width:480px}@media(max-width:650px){.medical-studio{left:4px;right:4px;bottom:4px;height:48%}.ms-body{grid-template-columns:115px 1fr}.ms-tools{gap:3px}.ms-tools button{font-size:10px}}

/* Studio ocupa un raíl inferior común, fuera del contexto de apilamiento del visor. */
.medical-studio-open .split{--ms-height:min(43%,340px);--ms-reserve:calc(var(--ms-height) + 24px)}
.medical-studio-open .split>.medical-studio{height:var(--ms-height);min-height:0;box-sizing:border-box;z-index:250}
.medical-studio-open #hierarchyPanel,.medical-studio-open #inspectorPanel,.medical-studio-open #pathologyPanel{bottom:var(--ms-reserve)!important;height:auto!important;min-height:0!important;overflow:hidden!important}
.medical-studio-open .side-panel-body{min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain}
.medical-studio-open .side-panel:not(.is-collapsed) .side-panel-body{flex:1 1 0!important}
.medical-studio-open .viewer-column{bottom:var(--ms-reserve);height:auto!important}
.medical-studio-open .anatomy-float,.medical-studio-open .visibility-float{max-height:calc(50dvh - 80px);overflow:auto}
.ms-row{grid-template-columns: minmax(120px,23%) minmax(180px,1fr) 260px;min-width:650px}.ms-fields{overflow:auto}.ms-scale{position:sticky;top:0;background:var(--panel,#182533);z-index:3;min-height:42px}.ms-axis{min-width:0;position:relative}.ms-axis input{width:100%;box-sizing:border-box;margin:0;padding:0;display:block}.ms-ticks{height:17px;position:relative;font-size:10px;white-space:nowrap}.ms-ticks span{position:absolute;transform:translateX(-50%)}.ms-ticks span:first-child{transform:none}.ms-ticks span:last-child{transform:translateX(-100%)}.ms-playhead{position:absolute;left:var(--ms-time,0%);top:-3px;bottom:-3px;width:2px;background:#ffd36e;pointer-events:none;z-index:2}.ms-active .ms-label{color:#ffd36e;font-weight:700}.ms-active .ms-clip{outline:1px solid #ffd36e}.ms-rows{position:relative;overflow:auto}.ms-ruler output{font-variant-numeric:tabular-nums}
@media(max-width:650px){.medical-studio-open .split{--ms-height:48%;--ms-reserve:calc(var(--ms-height) + 12px)}}

.medical-studio .ms-body{display:flex;flex-direction:column}.medical-studio .ms-timeline{flex:1}.medical-studio .ms-row{grid-template-columns:minmax(135px,23%) minmax(180px,1fr) 260px}

.medical-studio-login{box-sizing:border-box;width:min(480px,94vw);max-height:94dvh;padding:12px;border:1px solid var(--line,#53677c);border-radius:9px;background:var(--panel,#182533);color:var(--text,#e4edf6);overflow:auto}.medical-studio-login::backdrop{background:#0009}.ms-login-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.ms-login-head button{cursor:pointer;color:inherit;background:transparent;border:1px solid currentColor;border-radius:4px;padding:5px}.ms-login-status{font-size:12px;margin:8px 0}.medical-studio-login iframe{display:block;width:100%;height:min(500px,70dvh);border:0;background:#fff;border-radius:5px}

.ms-login-status:empty{display:none}

.ms-texts{display:grid;gap:5px;margin-top:8px}.ms-text-row{display:grid;grid-template-columns:minmax(160px,1fr) minmax(160px,1fr) auto auto;gap:5px;align-items:center}.ms-text-row span{overflow-wrap:anywhere}.ms-text-row input{width:100%;box-sizing:border-box}

.medical-studio-open .split>.medical-studio{overflow:visible}.ms-min-tab{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);width:72px;height:24px;border-radius:8px 8px 0 0!important;font-size:18px!important;line-height:16px}.medical-studio-minimized .split{--ms-height:34px;--ms-reserve:58px}.medical-studio.ms-minimized>:not(.ms-head):not(.ms-min-tab){display:none!important}.ms-current-phase{padding:5px 0;color:inherit;font-weight:700}.medical-studio .ms-label{white-space:normal;overflow-wrap:anywhere}

.ms-selected-end{outline:2px solid #ffd36e}.ms-fields button{white-space:nowrap}.ms-tools button[aria-label]{min-width:30px;font-size:15px}
.ms-clip[role=button]{pointer-events:auto;cursor:grab;touch-action:none;min-width:4px;z-index:1}.ms-clip.ms-block-selected{outline:2px solid #fff;outline-offset:1px}.ms-handle{position:absolute;top:0;bottom:0;width:7px;background:#ffffff85;cursor:ew-resize;touch-action:none}.ms-handle-start{left:0}.ms-handle-end{right:0}.ms-clip:focus-visible{outline:2px solid #8edcff}.ms-row{min-height:28px}

.ms-motion-controls{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:5px;border:1px solid var(--line,#526578);border-radius:4px}.ms-motion-controls input{width:65px}.ms-motion-controls span{font-size:11px}
.ms-key-row,.ms-scale{grid-template-columns:110px minmax(0,1fr)!important;padding-right:14px}.ms-key-track{overflow:visible!important;min-height:32px;margin:0 8px;touch-action:none}.ms-key-segment{position:absolute;top:50%;height:3px;background:#8c9db3;pointer-events:none}.medical-studio .ms-diamond{position:absolute;top:50%;transform:translate(-50%,-50%);padding:0;border:0;background:transparent;color:#b69bdc;font-size:19px;line-height:24px;min-width:20px;z-index:3;cursor:ew-resize;touch-action:none}.medical-studio .ms-diamond.ms-key-selected{color:#ffd36e;text-shadow:0 0 4px #fff}.ms-key-track .ms-playhead{pointer-events:none}.ms-key-row>button{text-align:left}.ms-scale .ms-axis{margin:0 8px}

/* Studio: native range keeps pointer ownership during continuous seeking. */
.ms-axis input[type=range]{touch-action:none;cursor:ew-resize;pointer-events:auto}

.ms-phase-bar{justify-content:flex-start;flex-wrap:nowrap;margin-bottom:4px}.ms-phase-bar output{white-space:nowrap;flex:0 0 auto}.ms-phase-bar select{max-width:calc(100% - 120px)}

/* Cabecera del editor: reloj y selector en la misma barra; icono SVG centrado. */
.medical-studio .ms-min-tab{display:grid!important;place-items:center!important;padding:0!important;margin:0!important;line-height:0!important;box-sizing:border-box}
.ms-min-tab svg{display:block;width:18px;height:18px;pointer-events:none}.ms-minimized .ms-min-tab svg{transform:rotate(180deg)}
.ms-head{flex-wrap:nowrap;min-width:0}.ms-head>strong{flex:0 0 auto}.ms-head>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-head>.ms-phase-bar{margin:0;flex:0 1 auto;min-width:0;gap:8px}.ms-head>.ms-phase-bar select{min-width:0;max-width:clamp(100px,30vw,440px);flex:1 1 auto}.ms-head>button{flex:0 0 auto;white-space:nowrap}
@media(max-width:650px){.ms-head>strong{font-size:10px}.ms-head>span{display:none}.ms-head>.ms-phase-bar{flex:1}.ms-head>.ms-phase-bar select{max-width:100%}}

/* Cabecera: título, reloj y fases agrupados a la izquierda; cerrar al extremo derecho. */
.ms-head{justify-content:flex-start}.ms-head>span{flex:0 1 auto}.ms-head>button{margin-inline-start:auto}
@media(max-width:650px){.ms-head>.ms-phase-bar{flex:0 1 auto}}

/* Studio: los rombos de frontera son referencias al mismo punto global. */
.medical-studio .ms-diamond.ms-key-boundary{color:#62c7d9}.medical-studio .ms-diamond.ms-key-boundary.ms-key-selected{color:#ffd36e}.medical-studio .ms-diamond.ms-key-external{cursor:pointer}.ms-external-time{position:absolute;top:0;transform:translateX(-50%);font-size:9px;color:#62c7d9;pointer-events:none;z-index:4}.ms-key-segment[data-interpolation=hold]{height:2px;background:repeating-linear-gradient(90deg,#8c9db3 0 4px,transparent 4px 8px)}.ms-key-segment[data-interpolation=smooth]{background:#79b6a6}.ms-hint select{margin-inline:5px}.ms-hint button{margin-inline:4px}

/* Studio: acciones SVG e interpolación junto al selector de fase. */
.medical-studio .ms-icon-action{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:28px;white-space:nowrap;flex:0 0 auto}.ms-icon-action svg{width:18px;height:18px;display:block;flex:none;pointer-events:none}.ms-icon-action span{flex:none;opacity:1}.ms-head>.ms-phase-bar .ms-step-select{flex:0 1 auto;min-width:70px}.ms-head>.ms-phase-bar .ms-interpolation-select{flex:0 0 auto;width:auto;max-width: none;min-width:0}.ms-head>.ms-phase-bar{flex-wrap:wrap}.ms-head>.ms-phase-bar .ms-icon-action{flex:0 0 auto}.ms-head>.ms-phase-bar .ms-icon-action span{flex:none;opacity:1}@media(max-width:850px){.ms-head{flex-wrap:wrap}.ms-head>.ms-phase-bar{flex:1 1 240px}.ms-head>.ms-phase-bar .ms-step-select{max-width:100%;flex:1 1 100px}}

.medical-studio .ms-duration{width:75px;flex:0 0 75px;font-variant-numeric:tabular-nums}.ms-duration-unit{flex:none!important}.medical-studio .ms-duration-handle{position:absolute;right:-14px;top:1px;width:22px;height:30px;padding:1px;z-index:6;cursor:ew-resize;touch-action:none;color:#ffd36e;background:var(--panel,#182533)}.ms-duration-handle svg{width:100%;height:100%;pointer-events:none}.ms-scale{overflow:visible}

.ms-marquee{position:absolute;pointer-events:none;z-index:8;border:1px solid #71b8ef;background:#71b8ef33;box-sizing:border-box}.ms-key-track{user-select:none}

.ms-static-phase{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;font-size:11px;opacity:.7;white-space:nowrap}
