/* Reading aids sit above the image, below the existing lens and transcription layers. */
.ark-enhanced-image { position: absolute; pointer-events: none; z-index: 3; }
.ark-enhanced-image[hidden], .ark-enhance-selection[hidden], .ark-reading-ruler[hidden],
#clearContrastRegionBtn[hidden], #readingRulerPosition[hidden] { display: none !important; }
.ark-enhance-selection { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.ark-enhance-selection.selecting { pointer-events: auto; cursor: crosshair; touch-action: none; }
.ark-enhance-selection-rect { position: absolute; border: 2px dashed #ffd700; background: rgba(255,215,0,.06); }
.ark-reading-ruler { position: absolute; left: 0; right: 0; z-index: 40; pointer-events: none; height: 24px; border-bottom: 2px solid #ffc107; background: rgba(255,193,7,.10); }
.ark-reading-ruler > button { position: absolute; right: 8px; top: -4px; pointer-events: auto; touch-action: none; width: 30px; height: 30px; padding: 0; border: 1px solid #ffc107; border-radius: 4px; background: #292d3e; color: #ffc107; cursor: ns-resize; }
.ark-image-profiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; }
.ark-image-profile { min-width: 0; padding: .3rem; background: #26283c; color: #eee; border: 1px solid #75758b; border-radius: .35rem; }
.ark-image-profile[aria-pressed="true"] { border: 2px solid #ffc107; padding: calc(.3rem - 1px); }
.ark-image-profile canvas { display: block; width: 100%; height: auto; background: #111; }
.ark-image-profile span { display: block; padding-top: .25rem; font-size: .75rem; }
#filterControlsHostHeader .dropdown-menu { width: min(390px, calc(100vw - 24px)); max-height: min(80vh, 850px); overflow-y: auto; }
.ark-image-profile:focus-visible, .ark-reading-ruler > button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Profiles and manual controls have separate menus in the viewer navbar. */
#profileControlsHostHeader .dropdown-menu {
  width:min(500px,calc(100vw - 24px));
  max-height:80vh;
  overflow-y:auto;
}
#profileControlsHostHeader .ark-image-profiles { grid-template-columns:repeat(3,minmax(0,1fr)); }
#filterControlsHostHeader .dropdown-menu {
  width:min(330px,calc(100vw - 24px));
  padding:.65rem .8rem!important;
}
#filterControlsRoot .mb-3 { margin-bottom:.5rem!important; }
#filterControlsRoot .form-label { font-size:.8rem; line-height:1.2; margin-bottom:.2rem!important; }
#filterControlsRoot .form-range { display:block; height:1.1rem; margin:0; padding:0; }
#filterControlsRoot .form-range::-webkit-slider-thumb { width:.85rem; height:.85rem; margin-top:-.3rem; }
#filterControlsRoot .form-range::-webkit-slider-runnable-track { height:.25rem; }
#filterControlsRoot .form-range::-moz-range-thumb { width:.85rem; height:.85rem; }
#filterControlsRoot .form-range::-moz-range-track { height:.25rem; }
#filterControlsRoot .dropdown-divider { margin:.4rem 0!important; }
#filterControlsRoot .form-check-label { font-size:.8rem; }
#filterControlsRoot .form-select-sm { font-size:.8rem; padding-top:.2rem; padding-bottom:.2rem; }
#filterControlsRoot #resetRotationBtn { font-size:.75rem; padding:.15rem .4rem; margin-top:.15rem; }
@media(max-width:575.98px) {
  #profileControlsHostHeader .ark-image-profiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
