/* Focusing a control must not scroll the canvas inside a scaled iPad iframe. */
#app { overflow:clip }
#masthead .top-tools { align-items:center }
#language {
  min-block-size:44px; max-inline-size:9rem; min-inline-size:0;
  padding-inline:9px; border:1px solid #e2cca4; border-radius:12px;
  background:#fff8e6; color:#22594f; font:700 12px system-ui,sans-serif;
}
#language:focus-visible { outline:2px solid #267b6a; outline-offset:3px }
#home #rank-start {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  min-block-size:44px;
}
#home #rank-start small { white-space:nowrap; font-size:.76em }
#home .hero-meta { top:calc(24% + 397px) }
.control-row { direction:ltr }
.control-row button span { unicode-bidi:isolate }
[dir="rtl"] .hero-copy,[dir="rtl"] .hero-meta { text-align:start }
[dir="rtl"] .result-metrics,[dir="rtl"] .result-tasks { direction:rtl }
[dir="rtl"] .route-meta { unicode-bidi:isolate }
#submit-status { font-size:13px; line-height:1.45; margin-block:4px; color:#285955 }
#result-ranks { min-block-size:40px }
#app[data-ranked="true"] #station-rank-timer:not([hidden]) { display:block; color:#97602a; font-size:12px }
@media (max-width:760px) and (orientation:portrait) {
  #home .hero-meta { top:auto }
  #masthead .brand > span:last-child { max-width:8rem; overflow:hidden; text-overflow:ellipsis }
  #language { max-inline-size:5.25rem; font-size:10px }
  #masthead .top-tools { gap:5px }
  #masthead .icon-button { width:40px; height:42px }
}
@media (max-width:395px) {
  #masthead .brand > span:last-child { display:none }
  #masthead .brand { padding:4px 5px }
}
@media (max-height:530px) and (orientation:landscape) {
  #home .hero-meta { top:auto; bottom:calc(87px + var(--safe-bottom)) }
  #home .home-actions { grid-template-columns:1fr 1.7fr .9fr; gap:8px }
  #home #rank-start { flex-direction:column; justify-content:center; gap:2px; min-width:0 }
  #home .home-actions .button { padding-inline:5px; font-size:12px }
}

#submit-status:empty{display:none}

@media (orientation:landscape) and (max-height:440px) {
  #result-modal {width:min(540px,100%)}
  #result-modal .receipt-sheet {
    display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
    gap:5px 14px; padding:13px 19px 15px;
  }
  #result-modal .receipt-meta {grid-column:1;grid-row:1;min-height:22px}
  #result-modal .receipt-heading {grid-column:1;grid-row:2;margin:1px 0;grid-template-columns:30px minmax(0,1fr);gap:7px}
  #result-modal .result-emblem {width:30px;height:33px;font-size:17px;border-radius:8px}
  #result-modal #result-title,#result-modal[data-mode="free"] #result-title {font-size:19px;line-height:1.14}
  #result-modal #result-message {margin-top:3px;font-size:11px;line-height:1.28}
  #result-modal .result-stars {grid-column:1;grid-row:3;min-height:26px;font-size:23px;margin:0;gap:8px}
  #result-modal .result-stars span:nth-child(2) {font-size:28px}
  #result-modal .result-metrics {grid-column:1;grid-row:4;margin:2px 0 0}
  #result-modal .result-metrics>div {padding:5px 2px}
  #result-modal .result-metrics strong {font-size:18px}
  #result-modal .result-metrics span {font-size:9px;margin-top:2px}
  #result-modal .result-tasks {grid-column:2;grid-row:1 / 4;margin:0;border:0;padding:0;align-content:center;gap:4px;font-size:10px}
  #result-modal[data-mode="free"] .result-tasks {margin:0;padding:0}
  #result-modal .result-record-feedback,#result-modal #submit-status {grid-column:2;grid-row:4;margin:0;padding:3px;align-self:center;font-size:10px}
  #result-modal .result-record-feedback>strong,#result-modal .result-record-feedback>span {font-size:10px;line-height:1.3}
  #result-modal .receipt-actions {grid-column:1/-1;grid-row:5;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:10px;margin-top:6px}
  #result-modal #result-next {font-size:14px;min-height:44px;padding:5px}
  #result-modal .receipt-secondary-actions:has(#result-ranks:not([hidden])) {grid-template-columns:repeat(2,minmax(0,1fr))}
  #result-modal #result-retry,#result-modal #result-map,#result-modal #result-ranks {min-height:44px;font-size:11px;padding:5px}
}

html[data-mobile-embedded-game="sky-courier"] #masthead .top-tools { display:none }
html[data-mobile-embedded-game="sky-courier"] #app[data-screen="home"] #masthead { display:none }
html[data-mobile-embedded-game="sky-courier"] #home .hero-copy { top:calc(32px + var(--safe-top)) }
