.mobile-sheet > .sheet-grip {
  display: none;
}

@media (max-width: 760px) {
  :is(#desk-dialog, .choice-dialog, .dt-panel, .student-choice-dialog, .manual-review-dialog).mobile-sheet[open] {
    --sheet-visible-height: var(--sheet-viewport-height, 100dvh);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: auto 0 var(--sheet-viewport-bottom, 0px);
    margin: 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(var(--sheet-visible-height) * .86);
    overflow: hidden;
    padding-top: 0;
    padding-left: max(var(--sheet-side-padding, 0px), env(safe-area-inset-left));
    padding-right: max(var(--sheet-side-padding, 0px), env(safe-area-inset-right));
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    box-sizing: border-box;
    overscroll-behavior: contain;
  }

  :is(#desk-dialog, .choice-dialog, .dt-panel, .student-choice-dialog, .manual-review-dialog).mobile-sheet.sheet-full[open] {
    height: var(--sheet-visible-height);
    max-height: var(--sheet-visible-height);
    padding-top: env(safe-area-inset-top);
    border: 0;
    border-radius: 0;
  }

  :is(#desk-dialog, .choice-dialog, .dt-panel, .student-choice-dialog, .manual-review-dialog).mobile-sheet.sheet-dragging[open] {
    height: var(--sheet-drag-height, auto);
    max-height: var(--sheet-visible-height);
    translate: 0 var(--sheet-drag-y, 0px);
  }

  .mobile-sheet.sheet-full.sheet-dragging[open] {
    --sheet-drag-height: var(--sheet-visible-height);
  }

  .mobile-sheet > button.sheet-grip {
    flex: 0 0 40px;
    align-self: stretch;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    appearance: none;
    background: transparent;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .sheet-grip::before {
    content: "";
    width: 38px;
    height: 4px;
    border-radius: 4px;
    background: #b7c0cf;
  }

  .sheet-grip:focus-visible {
    outline: 0;
  }

  .sheet-grip:focus-visible::before {
    background: #4264ca;
    outline: 2px solid #5877d5;
    outline-offset: 4px;
  }

  .sheet-dragging > button.sheet-grip {
    cursor: grabbing;
  }

  .sheet-dragging > .sheet-grip::before {
    background: #8391a8;
  }

  :is(#desk-dialog, .student-choice-dialog).mobile-sheet > .dialog-head {
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 10px;
  }

  .mobile-sheet > :is(.dialog-body, .dt-panel-body, .choice-options) {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  #desk-dialog.sheet-full .dialog-body > form:has(> .form-actions) {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  #desk-dialog.sheet-full .dialog-body > form > .form-actions {
    margin-top: auto;
  }

  .mobile-sheet > :is(.choice-head, .dt-panel-head, .dt-footer) {
    flex: none;
  }

  .manual-review-dialog.mobile-sheet > .manual-review {
    flex: 1 1 auto;
    min-height: 0;
  }

  dialog.choice-dialog.mobile-sheet {
    --sheet-side-padding: 14px;
  }

  .mobile-sheet > :is(.choice-head, .dt-panel-head) {
    padding-top: 0;
  }

  .mobile-sheet > .choice-head::before {
    content: none;
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  dialog.mobile-sheet.sheet-closing::backdrop {
    opacity: 0;
    transition: opacity 180ms ease-out;
  }
}
