/* Phone presentation only. Desktop rules and document flow remain unchanged. */
@media (max-width:600px) {
  body:has(#screen-question.active,#screen-qresult.active) {
    padding:calc(56px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  }
  body:has(#screen-question.active,#screen-qresult.active) .topbar {
    padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));
    min-height:calc(50px + env(safe-area-inset-top));
  }
  body:has(#screen-question.active,#screen-qresult.active) .topbar-icon-btn {width:44px;height:44px}
  #screen-question .q-meta-bar {margin:0 0 8px;gap:5px 10px;grid-template-columns:auto 1fr auto}
  #screen-question .round-pills {grid-row:2;grid-column:1/-1}
  #screen-question .challenge-pill {font-size:10px}
  #q-progress-label {grid-column:3}
  #screen-question .game-card {padding:12px 14px;overflow:visible}
  #screen-question .question-media {padding:0;gap:3px;position:relative}
  #screen-question .item-stage {height:clamp(80px,calc(100svh - 510px),220px)}
  #screen-question .photo-open {padding:0 10px}
  #screen-question .media-status,#screen-question .media-credit {display:none}
  /* The same full caption and credit remain available in the photo dialog. */
  #screen-question .view-details {min-height:28px;padding:4px 12px;font-size:10px;margin:1px 0 7px}
  #screen-question .photo-thumbnails {gap:6px}
  #screen-question .photo-thumb {width:40px;height:40px;padding:3px}
  #screen-question .question-copy {display:flex;flex-direction:column;gap:0;padding:0}
  #screen-question .q-round-tag {display:none}
  #screen-question .q-text {font-size:1.625rem;line-height:1.12;letter-spacing:-.02em;margin:0 0 8px;text-wrap:pretty;order:0}
  #screen-question .q-hint {font-size:.6875rem;line-height:1.4;margin:0 0 10px;order:1}
  #screen-question .game-card-inner {display:contents}
  #screen-question .ledger-label {font-size:.6875rem;margin:0 0 5px;order:2}
  #screen-question .ledger-label span {font-size:.625rem}
  #screen-question .ledger-input-row {padding:4px 12px;gap:10px;min-height:48px;order:3}
  #screen-question .ledger-currency {font-size:1.5rem}
  #screen-question #guess-input {font-size:1.75rem;line-height:1.3;min-height:36px;scroll-margin-block:70px}
  #screen-question .input-error-message {order:4;margin:5px 0 0}
  #screen-question .q-actions {order:5;margin:8px 0 0}
  #screen-question .btn-submit {min-height:48px;font-size:.875rem;padding:8px 12px;gap:20px}
  #screen-question .btn-submit:after {font-size:24px}
  #screen-question .guess-tools {order:6;margin:4px 0 0}
  #screen-question .guess-tools .mod-row {margin-top:4px}
  #screen-question .guess-tools .mod-btn {min-height:44px}
  body.mobile-price-focus #screen-question .item-stage {height:var(--focused-media-height)}
  body.mobile-price-focus #screen-question .q-hint {display:none}
  body.mobile-price-focus #screen-question .q-text {font-size:1.25rem;margin-bottom:8px}
  #screen-qresult .q-meta-bar {margin:0 0 6px;gap:8px}
  #screen-qresult .round-pills {margin:0 0 8px}
  #screen-qresult .game-card {padding:14px;overflow:visible}
  #screen-qresult .reveal-item {font-size:.6875rem;line-height:1.4;margin:0 0 8px}
  #screen-qresult .result-prices {gap:10px}
  #screen-qresult .rp-tile {padding:4px 0}
  #screen-qresult .rp-label {font-size:.625rem;margin-bottom:6px}
  #screen-qresult .rp-yours .rp-value {font-size:1.25rem;overflow-wrap:anywhere}
  #screen-qresult .rp-real .rp-value {font-size:1.875rem;overflow-wrap:anywhere}
  #screen-qresult .result-score-row {margin:10px 0}
  #screen-qresult .rs-multiplier {font-size:2rem}
  #screen-qresult .rs-dir {font-size:.6875rem;margin-top:4px}
  #screen-qresult .distribution-block {margin:6px 0 10px;padding:0 10px}
  #screen-qresult .rs-chart-label {font-size:.5625rem}
  #screen-qresult .candle-chart {height:96px}
  #screen-qresult #btn-next {width:100%;min-height:48px;margin:8px 0;font-size:.875rem}
  #screen-qresult .story-block {margin:4px 0 0;padding:4px 0 0}
  #screen-qresult .napkin-body {font-size:.75rem;line-height:1.5;padding:4px 0}
  #screen-qresult .story-source {font-size:.6875rem}
  .photo-dialog {max-height:calc(100dvh - 24px);padding:12px}
  .photo-dialog img {height:55dvh}
  .settings-overlay {padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .settings-card {max-height:calc(100dvh - 24px);overflow-y:auto}
  .drawer {max-height:100dvh;overflow-y:auto;padding-top:max(20px,env(safe-area-inset-top));padding-bottom:max(20px,env(safe-area-inset-bottom))}
}
