@media (orientation: portrait) and (max-width: 600px) {
  body.jmQuizPlay.jmQuizQuestion #panel.over {
    padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)) !important;
  }

  body.jmQuizPlay.jmQuizQuestion #panel.over .box {
    width: min(100%, 480px) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom))) !important;
    padding: 18px 16px 16px !important;
    border-radius: 22px;
    overscroll-behavior: contain;
  }

  body.jmQuizPlay.jmQuizQuestion #panel #qTitle {
    margin: 0 0 14px !important;
    color: var(--jm-ui-ink, #273d6c);
    font-size: clamp(19px, 5.3vw, 23px) !important;
    line-height: 1.4 !important;
    text-align: left;
  }

  body.jmQuizQuestion #panel #qCard > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }

  body.jmQuizQuestion #panel #qMsg {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 2;
    height: auto !important;
    max-height: 30dvh;
    overflow: auto;
    margin: 0 !important;
    padding: 9px 12px;
    color: #8e235c;
    background: #fff0f7;
    border-inline-start: 3px solid #e877aa;
    border-radius: 8px;
    font-size: 15px !important;
    line-height: 1.45;
    text-align: left;
    overflow-wrap: anywhere;
  }

  body.jmQuizQuestion #panel #qMsg:empty { display: none; }

  body.jmQuizPlay.jmQuizQuestion #panel #choices:not(.ox, .short) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.jmQuizPlay.jmQuizQuestion #panel #qCard:has(#clock > :is(img, canvas, svg)) #choices:not(.ox, .short, .txt) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.jmQuizPlay.jmQuizQuestion #panel #choices > button {
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 9px 12px !important;
    font-size: clamp(16px, 4.4vw, 18px) !important;
    line-height: 1.4 !important;
  }

  body.jmQuizPlay.jmQuizQuestion #panel #choices.txt > button,
  body.jmQuizPlay.jmQuizQuestion #panel #qCard:not(:has(#clock > :is(img, canvas, svg))) #choices:not(.ox, .short) > button {
    grid-column: auto !important;
    justify-content: flex-start;
    text-align: left;
  }

  body.jmQuizPlay.jmQuizQuestion #panel #clock:empty { display: none !important; }

  body.jmQuizPlay.jmQuizQuestion :is(#jmFixedProfile, #jmSharedQR) {
    visibility: hidden;
  }

  body.jmQuizPlay:not(.jmQuizQuestion):has(#bubble:not(.fade, [data-empty='true'])) #progressPanel {
    visibility: hidden;
  }

  body.inTouch #ctlHint.t {
    left: max(calc(50% + 12px), 178px) !important;
    right: 12px;
    transform: none !important;
    margin-top: -32px;
    padding: 6px 10px;
    font-size: 13px;
    white-space: normal;
    word-break: keep-all;
    background: #273d6ceb;
  }

  body.inTouch #ctlHint.t::before {
    position: absolute;
    top: 50%;
    right: 100%;
    border-block: 5px solid transparent;
    border-right: 6px solid #273d6ceb;
    transform: translateY(-50%);
    content: '';
  }
}

@media (orientation: portrait) and (max-height: 640px) and (max-width: 600px) {
  body.jmQuizPlay.jmQuizQuestion #panel.over .box { padding: 12px !important; }
  body.jmQuizPlay.jmQuizQuestion #panel #qTitle {
    margin-bottom: 10px !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
  }
  body.jmQuizPlay.jmQuizQuestion #panel #choices:not(.ox, .short) { gap: 6px !important; }
  body.jmQuizPlay.jmQuizQuestion #panel #choices > button {
    min-height: 46px !important;
    padding: 6px 9px !important;
    font-size: 15px !important;
    line-height: 1.32 !important;
  }
  body.jmQuizQuestion #panel #qMsg {
    padding-block: 7px;
    font-size: 14px !important;
  }
}
