/*
  Paired with chrome-lock.js: absolute top/bottom chrome,
  middle pane top/bottom from JS — real iOS scrollport.
*/
html.chrome-lock {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #1d4a3a;
}
:root[data-theme="dark"].chrome-lock,
html.chrome-lock[data-theme="dark"],
:root[data-theme="dark"] html.chrome-lock {
  background: #000;
}
html.chrome-lock:has(.preview-bar) {
  background: #111;
}
html.chrome-lock body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg, #f2f2f7);
  box-shadow: none;
}
html.chrome-lock body.doctor-deck {
  background: var(--ui-page, #f2f2f7);
}
.app.chrome-lock {
  position: relative;
  height: 100%;
  max-height: 100%;
  min-height: 0 !important;
  width: 100%;
  overflow: hidden;
}
body.doctor-deck.chrome-lock {
  /* body stays position:fixed (from rule above); it's the positioning root */
  max-height: 100%;
  min-height: 0 !important;
  overflow: hidden;
}
.app.chrome-lock > .chrome-top,
body.doctor-deck.chrome-lock > .chrome-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
}
.app.chrome-lock > .chrome-bot,
body.doctor-deck.chrome-lock > .chrome-bot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  z-index: 40;
}
.app.chrome-lock > .chrome-mid,
body.doctor-deck.chrome-lock > .chrome-mid {
  position: absolute;
  left: 0;
  right: 0;
  /* top/bottom set by chrome-lock.js */
  z-index: 1;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: 24px;
}

/* Clinic desk — same lock; side tabs stay under the green bar. */
html.chrome-lock body.desk {
  background: #e8eee9;
}
body.desk.chrome-lock {
  max-height: 100%;
  min-height: 0 !important;
  overflow: hidden;
}
body.desk.chrome-lock > .chrome-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
}
body.desk.chrome-lock .desk-wrap {
  display: block;
  min-height: 0;
  height: 100%;
}
body.desk.chrome-lock .desk-side {
  position: absolute;
  z-index: 35;
  background: #fff;
}
body.desk.chrome-lock .chrome-mid {
  position: absolute;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
