/* Keep the phone refinement sheet focused on the lettering. */
@media (max-width: 700px) {
  .font-refine-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    padding: 12px;
    border-radius: 26px;
    overscroll-behavior: contain;
  }

  .font-refine-panel::before {
    content: none;
  }

  /* aria-labelledby still provides the dialog's accessible name. */
  .font-refine-panel .font-refine-heading {
    display: none;
  }

  .font-refine-panel .refine-live-preview-wrap {
    position: relative;
    margin-bottom: 10px;
  }

  .font-refine-panel .refine-live-preview {
    height: clamp(190px, calc(40dvh - 60px), 260px);
    margin: 0;
    padding: 16px 60px 16px 16px;
    border-radius: 16px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .font-refine-panel .refine-live-preview-wrap > button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgb(250 250 249 / .88);
    color: #242424;
    font-size: 24px;
    line-height: 1;
    touch-action: manipulation;
  }

  .font-refine-panel .outline-smoothing.refine-range-row {
    margin-top: 8px;
  }

  .font-refine-panel .refine-fields {
    margin-top: 8px;
    gap: 8px;
  }

  .font-refine-panel .refine-fields button {
    margin-top: 0;
  }
}

@media (max-width: 700px) and (max-height: 600px) {
  .font-refine-panel .refine-live-preview {
    height: 150px;
  }
}
