/* Give the reading desk the full desktop window even when the navigation and
   import cards use a narrower measure. The source sidebar keeps its own split. */
.workspace.desktop-reader:not(.with-source) {
  --desk-gutter: clamp(12px, 1.6vw, 32px);
  width: calc(100vw - 2 * var(--desk-gutter));
  margin-inline-start: calc(50% - 50vw + var(--desk-gutter));
}
.desktop-reader:not(.with-source) > #reader {
  container: reader-frame / inline-size;
  width: min(100%, var(--reader-width, 100%));
  min-width: 0;
  justify-self: start;
}
.desktop-reader:not(.with-source) > #reader:not(.focused) {
  position: relative;
  padding-inline-end: 10px;
}
.desktop-reader:not(.with-source) > #reader.focused {
  --focus-width: 100%;
  inset-inline: 0 auto;
  padding-inline: 10px 24px;
}
body:has(.desktop-reader:not(.with-source) > .reader.focused)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  background: #1c2d26;
}
body:has(.desktop-reader:not(.with-source) > .reader.focused.paper-only)::before { background: #e9eee7; }
#reader-width-grip {
  position: absolute;
  inset-block: 8px;
  right: -8px;
  width: 23px;
  z-index: 2;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#reader-width-grip .divider-grip {
  position: sticky;
  top: max(30vh, 5rem);
  margin: clamp(4rem, 30vh, 16rem) auto 0;
  width: 19px;
  height: 58px;
}
#reader-width-grip .divider-grip::before {
  width: 7px;
  height: 23px;
}
#reader-width-grip:is(:hover,:focus-visible,[data-dragging]) .divider-grip {
  border-color: #24553b;
  background: #e2ecce;
  outline: 2px solid #365d44;
  outline-offset: 1px;
}
#reader-width-grip:focus-visible { outline-offset: -3px; border-radius: 8px; }
.reader.focused #reader-width-grip { right: 0; }
#reader-width-setting { display: grid; gap: 4px; }
#reader-width-setting label { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
#reader-width-value { color: #516253; font-variant-numeric: tabular-nums; }
#reader-width { width: 100%; min-height: 32px; }
#reader-width-reset { justify-self: start; min-height: 36px; padding-inline: .7rem; border: 1px solid #a8b8a8; color: var(--green); }
@container reader-frame (max-width: 43rem) {
  .reader > .panel-heading { flex-wrap: wrap; gap: .35rem; padding-inline: .7rem; }
  .reader .reader-tools { flex: 1 1 18rem; justify-content: end; flex-wrap: wrap; }
  .reader .reader-modes { gap: .35rem; }
  .reader .transport { flex-wrap: wrap; gap: .35rem; padding-inline: .65rem; }
  .reader .transport .restart { margin-inline-start: auto; }
}
@container reader-frame (max-width: 30rem) {
  .reader .panel-heading > h2 { font-size: 1rem; }
  .reader .reader-tools { gap: .25rem; }
  .reader .transport .restart span:last-child { display: none; }
  .reader .transport #start { flex: 1 1 auto; min-width: 0; }
  .reader .stage-foot { column-gap: .2rem; padding-inline: .35rem; }
  .reader .stage-foot #passage-name { min-width: 0; }
  .reader .paper-footer { padding-inline: .25rem; }
}

@media (min-width: 68.001rem) {
  .workspace.desktop-reader:not(.with-source):has(> #reading-settings:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) clamp(19rem, 24vw, 22rem);
  }
}
