/* Context controls use the existing WORMHOLES components and plot geometry. */
header #file-actions .file-popup{box-sizing:border-box;width:310px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 84px);overflow-y:auto;overscroll-behavior:contain}
header #file-actions .file-popup button{box-sizing:border-box;width:100%;height:auto;min-height:38px;border-radius:8px;padding:9px 10px;justify-content:flex-start;align-items:center;gap:10px;white-space:normal;text-align:left;line-height:1.35}
header #file-actions .file-popup button img{flex:none;width:19px;height:19px}
header #file-actions .file-popup,#toolbar-more>div{background:var(--surface,#fff)}
#toolbar-more>div{max-height:calc(100dvh - 110px);overflow-y:auto;overscroll-behavior:contain}
@media(min-width:901px){#rms-native-property{width:190px;max-width:190px}}
#history-demo-controls .showcase-follow{display:inline-flex;box-sizing:border-box;width:28px;min-width:28px;height:26px;min-height:26px;padding:3px;border-radius:7px;margin-left:5px}
#history-demo-controls .showcase-follow span{display:none}
#history-demo-controls .showcase-follow svg{width:18px;height:18px}
#quick-look .quick-look-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
#quick-look-close{flex:none;min-width:28px;min-height:28px;border-radius:7px;padding:4px;font:inherit}
#geosteering-controls-dock[hidden]{display:none!important}
#geosteering-controls-dock{display:flex;flex:none;flex-wrap:wrap;align-items:center;gap:5px 10px;padding:5px 8px;background:var(--surface,#fff);border-bottom:1px solid var(--line,#dce5ef);min-width:0}
#geosteering-data-note{color:var(--muted,#65758b);font-size:11px;margin-left:auto}
#model-log-form select,#model-log-form input[type=number]{box-sizing:border-box;width:100%;min-width:0}
#model-log-properties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;max-height:210px;overflow:auto;padding:8px;border:1px solid var(--line,#dce5ef);border-radius:8px;margin:10px 0}
#model-log-properties .model-log-option{display:flex;align-items:flex-start;gap:6px;min-width:0;line-height:1.4}
#model-log-properties input[type=checkbox]{flex:none;margin-top:3px}
@media(max-width:650px){#model-log-properties{grid-template-columns:1fr;max-height:180px}}
/* Mouse, trackpad and native touch gestures already control each plot directly. */
.geosteering-workspace #plot-toolbar :is(#fit,#zoom-in,#zoom-out,#pan-left,#pan-right,#depth-range,.navigation-target){display:none!important}
.geosteering-workspace #plot-toolbar :is(#target-line,#object-visible,#reference-position){display:none!important}
#dialog .editor-actions button{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;white-space:normal;padding:12px 14px;height:auto}
#dialog .editor-actions button small{font-weight:400;font-size:12px;color:var(--muted,#65758b);line-height:1.4}
#dialog .editor-advanced{margin-top:14px}
#dialog .editor-advanced summary{cursor:pointer;padding:8px 0}
#model-log-result p{margin:5px 0}
#model-log-result .model-log-swatch{display:inline-block;width:14px;height:10px;border:1px solid #7892;vertical-align:middle;margin-right:5px}
#model-log-form .model-log-source-details{font-size:12px;overflow-wrap:anywhere}
#model-log-styles .model-log-option{flex-wrap:wrap}
@media(min-width:651px){
 #geosteering-controls-dock #rms-native-controls{position:static;left:auto!important;top:auto!important;max-width:none!important;flex:1 1 350px;min-width:0;padding:0;gap:5px;background:transparent}
 #geosteering-controls-dock #rms-native-controls select{height:30px;max-width:none;font-size:12px;background:#fff;flex:1 1 180px;width:180px}
 #geosteering-controls-dock #rms-native-controls #rms-native-model{flex-basis:160px;min-width:140px}
 #geosteering-controls-dock #rms-native-controls #rms-native-property{width:190px;max-width:none;flex-basis:190px;min-width:175px}
 .geosteering-workspace #rms-native-author:disabled{display:none!important}
 #geosteering-controls-dock #plot-toolbar.toolbar-widget{position:relative!important;inset:auto!important;transform:none!important;width:auto;height:auto;max-width:none!important;min-height:30px;flex:0 0 auto;flex-wrap:wrap;padding:0;gap:4px;background:transparent;border:0;border-radius:0;box-shadow:none;will-change:auto;isolation:auto}
 #geosteering-controls-dock #plot-toolbar.toolbar-widget.widget-collapsed>:not([hidden]){display:initial!important}
 #geosteering-controls-dock #plot-toolbar.toolbar-widget :is(#toolbar-widget-handle,#toolbar-widget-toggle,#toolbar-context){display:none!important}
 #geosteering-controls-dock #plot-toolbar.toolbar-widget #toolbar-more-actions{top:calc(100% + 8px)!important;bottom:auto!important;right:0!important;max-height:calc(100dvh - 190px)!important;z-index:40}
 #geosteering-controls-dock #history-demo-controls{margin:0;align-self:center;flex:0 0 auto}
 #geosteering-controls-dock #plot-toolbar.toolbar-widget button:focus-visible{outline:2px solid #176cff;outline-offset:1px}
}

#dialog:has(.editor-actions),#dialog:has(#model-log-form),#dialog:has(#reference-form){background:var(--surface,#fff)}
#model-log-form details>summary{cursor:pointer;padding:8px 0;font-weight:600}

#model-log-form .dialog-actions button[hidden]{display:none!important}

/* Model logs use a compact task dialog; source engineering settings are secondary. */
#dialog:has(#model-log-form){width:min(640px,94vw)}
#model-log-form .model-log-source-caption{font-weight:600;color:var(--text,#243c53);margin:0 0 6px;overflow-wrap:anywhere}
#model-log-result{border:0;border-top:1px solid var(--line,#dce5ef);border-bottom:1px solid var(--line,#dce5ef);border-radius:0;padding:10px 0;margin:10px 0;font-size:12px;line-height:1.5}
#model-log-inputs>label,#model-log-inputs>details>label{display:grid;gap:5px;margin:10px 0}
#model-log-inputs>label.model-log-option{display:flex;flex-direction:row;align-items:center}
#model-log-properties[hidden],#model-log-range-fields[hidden]{display:none!important}
#model-log-styles input[type=number]{width:82px;flex:none}
#model-log-styles input[type=color]{width:34px;flex:none}
#model-log-form .dialog-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;margin-top:14px}
#model-log-form .dialog-actions button{width:auto;min-height:32px;padding:7px 12px;flex:0 1 auto}
#model-log-restore:disabled{display:none!important}
#model-log-form summary:focus-visible{outline:2px solid #176cff;outline-offset:2px;border-radius:5px}
@media(max-width:450px){#model-log-form .dialog-actions{display:flex}#model-log-form .dialog-actions button.apply{flex:1}}
