/* Short landscape content screens. Desktop rules remain in their owning stylesheets.
   Headers/footers keep their own rows; only the content row scrolls. */
@media (orientation: landscape) and (max-height: 700px) and (max-width: 1400px) {
  /* Campaign archive: the previous desktop title/tab/footer minima left a sliver
     for the list. Size the chrome first and let minmax(0,1fr) own the remainder. */
  #app.menu-bg > .missions-panel.mission-archive {
    inset: var(--screen-padding, 6px);
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(76px,auto) minmax(0,1fr) 86px;
    grid-template-rows: auto minmax(0,1fr) auto auto;
    gap: 5px;
  }
  #app .mission-archive > .eyebrow { display: none; }
  #app .mission-archive > h2 { grid-area: 1/1; align-self: center; margin: 0; font-size: 18px; line-height: 1.1; letter-spacing: .05em; }
  #app .mission-archive .mission-archive-nav { grid-area: 1/2; gap: 6px; margin: 0; flex-wrap: nowrap; }
  #app .mission-archive-nav button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 5px 6px; font-size: 12px; letter-spacing: .02em; }
  #app .mission-archive .missions-scroll { grid-area: 2/1/3/-1; min-height: 0; padding: 2px 5px 10px 0; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  #app .mission-archive .campaign-section { margin-bottom: 16px; }
  #app .mission-archive .campaign-section h3 { margin: 0 0 7px; font-size: 12px; }
  #app .mission-archive .campaign-section .missions-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #app .mission-archive article.mission-archive-card { min-height: 190px; grid-template-rows: minmax(58px,1fr) auto; }
  #app .mission-archive .mission-archive-stats { margin: 7px; padding: 6px 8px; font-size: 11px; gap: 3px; }
  #app .mission-archive .mission-archive-footer { grid-template-columns: minmax(0,1fr); gap: 7px; padding: 8px 10px; }
  #app .mission-archive .mission-archive-name { font-size: 15px; }
  #app .mission-archive .mission-archive-copy { gap: 3px; }
  #app .mission-archive .mission-archive-action { width: 100%; min-width: 0; min-height: 44px; padding: 6px; font-size: 12px; }
  #app .mission-archive .mission-feedback { grid-area: 3/1/4/-1; margin: 0; max-height: 30px; font-size: 11px; min-height: 0; }
  #app .mission-archive .mission-feedback:empty { display: none; }
  #app .mission-archive .missions-back { grid-area: 1/3; width: 100%; min-height: 44px; margin: 0; padding: 6px 12px; font-size: 13px; }
  #app .mission-archive .mission-archive-retry { grid-area: 4/1/5/-1; margin: 0; min-height: 44px; }

  /* Supply depot: one compact title/wallet row, a real product viewport, Back. */
  #app.reference-store .store-shell { inset: var(--screen-padding,6px); max-width: 1580px; padding: 8px; gap: 6px; min-height: 0; }
  #app.reference-store .store-header { min-height: 0; display: grid; grid-template-columns: minmax(88px,.22fr) minmax(0,1fr); gap: 10px; padding: 4px 8px; border-width: 4px; border-image-width: 6px; align-items: center; }
  #app.reference-store .store-header > div:first-child:not(.reference-store-wallet) { width: auto; min-width: 0; }
  #app.reference-store .store-kicker { font-size: 8px; line-height: 1.2; letter-spacing: .1em; }
  #app.reference-store .store-header h1 { font-size: 23px; letter-spacing: .07em; }
  #app.reference-store .reference-store-wallet { width: auto; min-width: 0; gap: 6px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  #app.reference-store .store-wallet { min-width: 0; min-height: 44px; padding: 4px 6px; gap: 6px; border-width: 4px; border-image-width: 6px; }
  #app.reference-store .store-wallet .wallet-icon { width: 23px; height: 25px; flex-basis: 23px; }
  #app.reference-store .store-key-balance .wallet-icon { width: 27px; height: 25px; flex-basis: 27px; }
  #app.reference-store .store-wallet small { font-size: 8px; letter-spacing: .02em; }
  #app.reference-store .store-wallet strong { font-size: 15px; line-height: 1.1; }
  #app.reference-store .store-content { min-height: 0; gap: 18px; padding: 3px 5px 14px 0; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  #app.reference-store .store-back { min-height: 44px; min-width: 160px; margin: 0; padding: 5px 18px; font-size: 13px; }
  #app.reference-store .reference-store-section > h2 { font-size: 15px; margin-bottom: 9px; padding-bottom: 7px; }
  #app.reference-store .reference-store-featured { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #app.reference-store .featured-store-products > .reference-store-card { min-height: 210px; }
  #app.reference-store .reference-store-card { padding: 12px; border-width: 7px; border-image-width: 9px; }
  #app.reference-store .reference-store-art { max-width: 100%; object-fit: contain; }
  #app.reference-store .cash-products, #app.reference-store .ruby-products, #app.reference-store .exchange-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #app.reference-store .cash-product, #app.reference-store .ruby-product { grid-template-columns: minmax(70px,.85fr) minmax(0,1.15fr); gap: 5px 8px; min-height: 195px; padding: 12px 9px; }
  #app.reference-store .cash-product h2, #app.reference-store .ruby-product h3 { font-size: 15px; }
  #app.reference-store .cash-product > strong, #app.reference-store .ruby-product > strong { font-size: 19px; }
  #app.reference-store .cash-product > b, #app.reference-store .ruby-product > b { font-size: 16px; }
  #app.reference-store .cash-product > .reference-store-cash-art, #app.reference-store .ruby-product > .reference-store-ruby-art { width: 100%; max-width: 100%; height: 140px; object-fit: contain; }
  #app.reference-store .reference-store-card button { min-height: 44px; font-size: 12px; padding: 5px 7px; }
  #app.reference-store .starting-coin-products, #app.reference-store .mission-key-products { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #app.reference-store .premium-card-actions { min-width: 0; }
  #app.reference-store .starting-coin-product h3, #app.reference-store .mission-key-products h3 { font-size: 15px; }
  #app.reference-store .daily-rubies-section .premium-product { padding: 12px; min-height: 150px; }
  #app.reference-store .daily-rubies-section .premium-product h3 { font-size: 18px; }
  #app.reference-store .reference-store-username { padding: 14px; gap: 12px; }
  #app.reference-store .premium-pass-store-card { grid-template-columns: 94px minmax(0,1fr); padding: 14px; gap: 14px; }
  #app.reference-store .premium-pass-store-card > img { width: 94px; height: 94px; object-fit: contain; }
  #app.reference-store .premium-pass-store-card h2 { font-size: 17px; }

  /* Service record stays a single column, with the card list independently
     scrollable and a persistent summary/Back instead of a scrolling dialog. */
  .account-ranks-screen { padding: var(--screen-padding,6px); }
  .account-ranks-screen .ranks-panel { display: grid; height: 100%; max-height: 100%; min-height: 0; grid-template-rows: auto auto minmax(0,1fr) auto; padding: 8px 10px; gap: 6px; border-width: 7px; border-image-width: 8px; overflow: hidden; }
  .account-ranks-screen .ranks-heading { padding: 0 0 4px; gap: 10px; }
  .account-ranks-screen .ranks-heading small, .account-ranks-screen .ranks-heading p { display: none; }
  .account-ranks-screen .ranks-heading h1 { font-size: 22px; margin: 0; }
  .account-ranks-screen .ranks-summary { margin: 0; padding: 0 5px 5px; }
  #brightness #account-ranks-screen #ranks-summary { min-height: 40px; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-component { grid-template-columns: 38px minmax(100px,max-content) minmax(100px,1fr) 30px; grid-template-rows: auto; gap: 8px; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-insignia { grid-area: 1/1; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-insignia, #brightness #account-ranks-screen #ranks-summary .account-rank-insignia img { width: 38px; height: 40px; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-identity { grid-area: 1/2; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-name { font-size: 13px; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-label { font-size: 8px; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-progress { grid-area: 1/3; padding: 0; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-number { grid-area: 1/4; font-size: 30px; }
  #brightness #account-ranks-screen #ranks-summary .account-rank-meter { height: 25px; }
  .account-ranks-screen .ranks-lifetime { font-size: 10px; margin: 0; }
  .account-ranks-screen .ranks-list { overflow: auto; min-height: 0; margin: 0; padding: 5px 6px 12px; gap: 12px; grid-template-columns: minmax(0,1fr); touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .account-ranks-screen .ranks-entry { min-height: 134px; grid-template-columns: 58px minmax(0,1fr) 40px; gap: 10px; padding: 10px 12px; border-width: 7px; }
  .account-ranks-screen .ranks-token img { width: 58px; height: 68px; }
  .account-ranks-screen .ranks-entry h2 { font-size: 17px; }
  .account-ranks-screen .ranks-entry p { font-size: 12px; line-height: 1.4; }
  .account-ranks-screen .ranks-entry-number { font-size: 33px; }
  .account-ranks-screen .ranks-meter { height: 28px; margin-block: 5px; }
  .account-ranks-screen .ranks-meter > strong { font-size: 13px; }
  .account-ranks-screen .ranks-panel > footer { position: static; padding: 5px 0 0; gap: 10px; box-shadow: none; }
  .account-ranks-screen footer p { font-size: 10px; }
  .account-ranks-screen .ranks-back { min-height: 44px; min-width: 100px; padding: 4px 10px; }

  /* The reward depot already has correct flow. Keep that flow but provide a
     compact sticky heading so Back never leaves the landscape viewport. */
  #app.daily-rewards-page.depot-flow-page { padding: var(--screen-padding,6px); background-attachment: scroll !important; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
  #app.depot-flow-page .depot-flow-shell { padding: 8px 10px; gap: 12px; }
  #app.depot-flow-page .depot-flow-shell > .depot-page-header { position: sticky; top: 0; z-index: 3; min-height: 0; padding: 6px 8px; gap: 12px; background: #0b1d29f5; border-bottom: 1px solid #ae94634d; }
  #app.depot-flow-page .depot-title > span { font-size: 9px; }
  #app.depot-flow-page .depot-title h1 { font-size: 24px; margin: 3px 0; }
  #app.depot-flow-page .depot-title > p { font-size: 11px; margin: 0; }
  #app.depot-flow-page .rewards-back { min-height: 44px; min-width: 80px; padding: 6px 12px; font-size: 12px; }
  #app.depot-flow-page .depot-season-info { padding: 10px 12px; gap: 6px 14px; }
  #app.depot-flow-page .depot-season-badge { grid-row: 1/4; padding: 7px 10px; min-width: 64px; }
  #app.depot-flow-page .depot-season-badge b { font-size: 22px; }
  #app.depot-flow-page .depot-current-day b { font-size: 21px; }
  #app.depot-flow-page .depot-expiration time { font-size: 11px; }
  #app.depot-flow-page .premium-pass-copy { grid-template-columns: 80px minmax(0,1fr); padding: 12px; gap: 10px 14px; }
  #app.depot-flow-page .premium-pass-copy > img { width: 80px; height: 90px; }
  #app.depot-flow-page .premium-pass-copy h2 { font-size: 16px; }
  #app.depot-flow-page .premium-pass-copy p { font-size: 11px; margin: 4px 0; }
  #app.depot-flow-page .depot-pass-actions { display: grid; grid-template-columns: 100px minmax(0,1fr) minmax(165px,.8fr); gap: 8px 12px; padding-top: 10px; }
  #app.depot-flow-page .depot-pass-price { font-size: 24px; }
  #app.depot-flow-page .premium-pass-copy button { min-height: 44px; }
  #app.depot-flow-page .reward-track-section { padding: 10px !important; }
  #app.depot-flow-page .depot-track-heading { gap: 8px; padding-bottom: 8px; flex-wrap: nowrap; align-items: center; }
  #app.depot-flow-page .depot-track-heading h2 { font-size: 17px; }
  #app.depot-flow-page .depot-track-controls { width: auto; gap: 7px; flex-shrink: 0; }
  #app.depot-flow-page .depot-track-controls > span { display: none; }
  #app.depot-flow-page .depot-track-controls button { width: 44px; height: 44px; min-height: 44px; min-width: 44px; }
  #app.depot-flow-page .depot-track-controls .depot-center-today { min-width: 65px; font-size: 9px; }
  #app.depot-flow-page .reward-track { padding: 10px 2px; gap: 9px; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
  #app.depot-flow-page .premium .reward-day { flex-basis: 164px; min-height: 282px; padding: 10px; gap: 5px; }
  #app.depot-flow-page .premium .reward-armored-container { height: 70px; }
  #app.depot-flow-page .premium .reward-armored-container img { width: 112px; max-height: 70px; }
  #app.depot-flow-page .premium .reward-crystal-group { width: 105px; height: 35px; }
  #app.depot-flow-page .reward-day .reward-amounts { font-size: 12px; gap: 4px; margin: 3px 0; }
  #app.depot-flow-page .reward-day button { min-height: 44px; font-size: 10px; }
  #app.depot-flow-page .free .reward-day { flex-basis: 145px; min-height: 218px; padding: 10px; gap: 5px; }
  #app.depot-flow-page .free .reward-free-crate { width: 80px; height: 48px; }
}

@media (orientation: landscape) and (max-height: 700px) and (min-width: 960px) and (max-width: 1400px) {
  #app .mission-archive .campaign-section .missions-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Mobile composition pass. The extra route classes keep these feature-owned
   layouts ahead of the legacy shared short-screen fallbacks. */
@media (orientation: landscape) and (max-height: 700px) and (max-width: 1400px) {
  /* Illustrated campaign cards retain their complete records and actions. */
  #app.menu-bg > .missions-panel.mission-archive { padding: 7px 9px; grid-template-columns: minmax(76px,auto) minmax(0,1fr) 84px; grid-template-rows: 44px minmax(0,1fr) auto auto; gap: 6px; }
  #app.menu-bg .mission-archive .mission-archive-nav { gap: 6px; }
  #app.menu-bg .mission-archive .campaign-section { margin-bottom: 15px; }
  #app.menu-bg .mission-archive .campaign-section .missions-grid { gap: 9px; }
  #app.menu-bg .mission-archive article.mission-archive-card { min-height: 174px; grid-template-rows: minmax(62px,1fr) auto; }
  #app.menu-bg .mission-archive .mission-archive-stats { margin: 6px; padding: 5px 7px; font-size: 11px; line-height: 1.3; gap: 2px; }
  #app.menu-bg .mission-archive .mission-archive-stats > div { gap: 8px; }
  #app.menu-bg .mission-archive .mission-archive-footer { grid-template-columns: minmax(0,1fr) minmax(88px,.58fr); gap: 7px; padding: 7px 8px 9px; }
  #app.menu-bg .mission-archive .mission-archive-name { font-size: 14px; }
  #app.menu-bg .mission-archive .mission-archive-stage,
  #app.menu-bg .mission-archive .mission-archive-state { font-size: 10px; }
  #app.menu-bg .mission-archive .mission-archive-copy { gap: 3px; }
  #app.menu-bg .mission-archive .mission-archive-record,
  #app.menu-bg .mission-archive .mission-archive-reward { font-size: 10px; line-height: 1.3; }
  #app.menu-bg .mission-archive .mission-archive-action { width: 100%; min-width: 0; min-height: 44px; padding: 6px; font-size: 11px; }

  /* One wallet/navigation row gives the products the remaining viewport. */
  #app.reference-store.store-page .store-shell { max-width: none; padding: 6px; gap: 7px; grid-template-columns: minmax(0,1fr) 84px; grid-template-rows: 48px minmax(0,1fr); }
  #app.reference-store.store-page .store-header { grid-area: 1/1; min-height: 0; height: 48px; grid-template-columns: minmax(75px,.22fr) minmax(0,1fr); gap: 8px; padding: 3px 7px; border-width: 3px; border-image-width: 5px; box-sizing: border-box; }
  #app.reference-store.store-page .store-kicker { display: none; }
  #app.reference-store.store-page .store-header h1 { margin: 0; font-size: 21px; letter-spacing: .05em; }
  #app.reference-store.store-page .store-wallet { flex-direction: row; min-height: 34px; height: 34px; padding: 2px 5px; gap: 5px; border-width: 3px; border-image-width: 4px; text-align: left; box-sizing: border-box; }
  #app.reference-store.store-page .store-wallet .wallet-icon { width: 21px; height: 23px; flex-basis: 21px; }
  #app.reference-store.store-page .store-key-balance .wallet-icon { width: 25px; height: 23px; flex-basis: 25px; }
  #app.reference-store.store-page .store-wallet .wallet-copy { gap: 2px; }
  #app.reference-store.store-page .store-wallet small { font-size: 8px; line-height: 1.1; letter-spacing: .02em; }
  #app.reference-store.store-page .store-wallet strong { font-size: 14px; line-height: 1.1; }
  #app.reference-store.store-page .store-content { grid-area: 2/1/3/-1; gap: 14px; }
  #app.reference-store.store-page .store-back { grid-area: 1/2; width: 84px; height: 44px; min-width: 0; align-self: center; padding: 5px 7px; font-size: 12px; letter-spacing: .02em; }
  #app.reference-store.store-page .store-back::before { margin-right: 6px; }
  #app.reference-store.store-page .reference-store-section > h2 { font-size: 14px; margin-bottom: 8px; padding-bottom: 6px; }
  #app.reference-store.store-page .reference-store-section > p { font-size: 12px; margin-bottom: 10px; }
  #app.reference-store.store-page .reference-store-featured { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  #app.reference-store.store-page .featured-store-products > .reference-store-card { min-height: 0; }
  #app.reference-store.store-page .reference-store-card { padding: 10px; border-width: 5px; border-image-width: 7px; }
  #app.reference-store.store-page :is(.cryo-store-product,.cryo-store-product.dossier-locked) { grid-template-columns: 68px minmax(0,1fr); gap: 6px 9px; align-content: start; padding: 10px; }
  #app.reference-store.store-page .cryo-store-product > .cryo-art { position: static !important; inset: auto !important; transform: none; grid-column: 1; grid-row: 1/3; width: 68px !important; height: 94px !important; max-height: 94px; margin: 0; }
  #app.reference-store.store-page .cryo-store-product > :is(.cryo-copy,h2) { position: static; grid-column: 2; grid-row: 1; margin: 0; align-self: start; font-size: 16px; }
  #app.reference-store.store-page .cryo-store-product .cryo-copy h2 { font-size: 16px; margin: 0 0 5px; }
  #app.reference-store.store-page .cryo-store-product .cryo-copy p { font-size: 11px; line-height: 1.35; margin: 4px 0 7px; }
  #app.reference-store.store-page .cryo-store-product > :is(.lavyna-information,.store-dossier-preview) { grid-column: 1/-1; grid-row: auto; margin: 0; padding: 0; font-size: 11px; }
  #app.reference-store.store-page .cryo-store-product .store-dossier-preview > p { font-size: 11px; margin: 4px 0; }
  #app.reference-store.store-page .cryo-store-product .store-dossier-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 5px 9px; }
  #app.reference-store.store-page .cryo-store-product .store-dossier-preview > p { margin: 0; font-size: 10px; line-height: 1.35; }
  #app.reference-store.store-page .cryo-store-product .store-dossier-preview .lavyna-information { margin: 0; padding: 0; font-size: 10px; }
  #app.reference-store.store-page .cryo-store-product .store-dossier-preview .lavyna-information > p { margin: 0 0 5px; font-size: 10px; line-height: 1.3; }
  #app.reference-store.store-page .cryo-store-product .store-dossier-preview .lavyna-information > button { width: 100%; }
  #app.reference-store.store-page .dossier-feedback:empty { display: none; }
  #app.reference-store.store-page .android-product-details { grid-column: 1/-1; grid-row: auto; min-width: 0; margin: 0; border-top: 1px solid #b1c6d13d; }
  #app.reference-store.store-page .android-product-details > summary { min-height: 44px; padding: 12px 5px 8px; box-sizing: border-box; color: #e9d397; font-size: 12px; line-height: 1.3; cursor: pointer; touch-action: manipulation; }
  #app.reference-store.store-page .lavyna-information .dossier-offers { gap: 6px; }
  #app.reference-store.store-page .featured-store-products .remove-ads-product { grid-template-columns: 68px minmax(0,1fr); grid-template-rows: auto auto; padding: 10px; gap: 7px 9px; align-content: start; }
  #app.reference-store.store-page .remove-ads-product > .reference-store-remove-art { position: static !important; grid-column: 1; grid-row: 1; width: 68px !important; height: 78px !important; max-height: 78px; margin: 0; }
  #app.reference-store.store-page .remove-ads-product > div:not(.premium-card-actions) { grid-column: 2; grid-row: 1; align-self: center; }
  #app.reference-store.store-page .remove-ads-product h2 { font-size: 16px; margin: 0 0 5px; }
  #app.reference-store.store-page .remove-ads-product p { font-size: 11px; line-height: 1.35; }
  #app.reference-store.store-page .remove-ads-product .premium-card-actions { grid-column: 1/-1; grid-row: 2; width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; }
  #app.reference-store.store-page .remove-ads-product .premium-card-actions > b { font-size: 19px; }
  #app.reference-store.store-page .remove-ads-product .premium-card-actions button { min-width: 0; }
  #app.reference-store.store-page :is(.cash-products,.ruby-products,.exchange-grid,.starting-coin-products,.mission-key-products) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  #app.reference-store.store-page :is(.cash-product,.ruby-product) { grid-template-columns: 76px minmax(0,1fr); gap: 3px 8px; min-height: 146px; padding: 9px; }
  #app.reference-store.store-page :is(.cash-product h2,.ruby-product h3) { font-size: 14px; line-height: 1.2; }
  #app.reference-store.store-page :is(.cash-product,.ruby-product) > strong { font-size: 18px; }
  #app.reference-store.store-page :is(.cash-product,.ruby-product) > b { font-size: 15px; }
  #app.reference-store.store-page .cash-product > .reference-store-cash-art,
  #app.reference-store.store-page .ruby-product > .reference-store-ruby-art { width: 76px; max-width: 76px; height: 108px; object-fit: contain; }
  #app.reference-store.store-page .reference-store-card button { min-height: 44px; font-size: 12px; padding: 5px 7px; }
  #app.reference-store.store-page .premium-card-actions { min-width: 0; gap: 7px; }
  #app.reference-store.store-page :is(.starting-coin-product,.mission-key-products > .premium-product) { grid-template-columns: 44px minmax(0,1fr); min-height: 0; padding: 10px; gap: 6px 8px; }
  #app.reference-store.store-page .starting-coin-product .coin-pack-icon { width: 40px; height: 40px; font-size: 26px; }
  #app.reference-store.store-page .mission-key-products .mission-key-art { width: 44px; height: 48px; }
  #app.reference-store.store-page :is(.starting-coin-product,.mission-key-products) h3 { font-size: 14px; margin: 0 0 5px; }
  #app.reference-store.store-page :is(.starting-coin-product,.mission-key-products) p { font-size: 11px; }
  #app.reference-store.store-page :is(.starting-coin-product,.mission-key-products > .premium-product) .premium-card-actions { grid-column: 1/-1; flex-direction: row; align-items: center; justify-content: space-between; }
  #app.reference-store.store-page .daily-rubies-section .premium-product { grid-template-columns: minmax(0,1fr) 130px; padding: 10px; min-height: 142px; gap: 8px 12px; }
  #app.reference-store.store-page .daily-rubies-section .premium-product h3 { font-size: 16px; margin-bottom: 6px; }
  #app.reference-store.store-page .daily-rubies-section .premium-product p { font-size: 11px; }
  #app.reference-store.store-page .daily-rubies-section .daily-diamonds { grid-column: 1 !important; grid-row: 2 !important; height: 68px !important; }
  #app.reference-store.store-page .daily-rubies-section .premium-card-actions { grid-column: 2 !important; grid-row: 1/3 !important; }
  #app.reference-store.store-page .exchange-grid > article { min-height: 151px; gap: 6px; padding: 9px; }
  #app.reference-store.store-page :is(.reference-store-exchange-ruby-art,.reference-store-exchange-cash-art) { width: 70px; height: 53px; }
  #app.reference-store.store-page :is(.exchange-cost,.exchange-cash) { font-size: 18px; }
  #app.reference-store.store-page .reference-store-username { padding: 12px; gap: 10px; }
  #app.reference-store.store-page .reference-store-username h2 { font-size: 16px; }
  #app.reference-store.store-page .reference-store-username p { font-size: 12px; }
  #app.reference-store.store-page .premium-pass-store-card { grid-template-columns: 70px minmax(0,1fr); padding: 12px; gap: 12px; }
  #app.reference-store.store-page .premium-pass-store-card > img { width: 70px; height: 78px; object-fit: contain; }
  #app.reference-store.store-page .premium-pass-store-card h2 { font-size: 16px; }
  #app.reference-store.store-page .premium-pass-store-card p { font-size: 12px; }

  /* Four illustrated modes use a compact 2 by 2 grid. Only that grid scrolls
     when the complete descriptions exceed a short phone's remaining height. */
  #app.training-hub.reference-minigames-hub { min-height: 0; height: 100%; padding: var(--screen-insets,6px); overflow: hidden; }
  #app.training-hub.reference-minigames-hub .minigames-shell { display: grid; grid-template-columns: minmax(230px,.95fr) minmax(0,1.05fr); grid-template-rows: 58px minmax(0,1fr) auto; height: 100%; min-height: 0; max-height: 100% !important; gap: 7px; padding: 0; }
  #app.training-hub.reference-minigames-hub .minigames-shell > header { grid-area: 1/1; position: relative; top: auto; min-height: 0; height: 58px; padding: 3px 9px; gap: 7px; justify-content: space-between; box-sizing: border-box; }
  #app.training-hub.reference-minigames-hub .minigames-shell > header > div { min-width: 0; }
  #app.training-hub.reference-minigames-hub header h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.05; letter-spacing: .05em; }
  #app.training-hub.reference-minigames-hub header span { font-size: 8px; line-height: 1.1; letter-spacing: .1em; }
  #app.training-hub.reference-minigames-hub .minigames-back { position: static; transform: none; min-width: 84px; min-height: 44px; height: 44px; padding: 4px 9px; font-size: 12px; }
  #app.training-hub.reference-minigames-hub .mini-chest-meter { grid-area: 1/2; min-width: 0; height: 58px; grid-template-columns: minmax(0,1fr) 90px; grid-template-rows: 17px 17px; gap: 3px 8px; margin: 0; padding: 8px 9px; box-sizing: border-box; }
  #app.training-hub.reference-minigames-hub .chest-meter-copy { gap: 6px; }
  #app.training-hub.reference-minigames-hub .chest-meter-copy > span { display: none; }
  #app.training-hub.reference-minigames-hub :is(.chest-round,.chest-percentage) { font-size: 13px; line-height: 1.2; }
  #app.training-hub.reference-minigames-hub .chest-meter-track { height: 17px; margin: 0; }
  #app.training-hub.reference-minigames-hub .chest-meter-prize { grid-column: 2; grid-row: 1/3; display: flex; flex-direction: row; align-items: center; gap: 4px; }
  #app.training-hub.reference-minigames-hub .chest-golden-art { width: 36px; height: 29px; }
  #app.training-hub.reference-minigames-hub .chest-meter-prize strong { flex-direction: column; gap: 2px; font-size: 8px; }
  #app.training-hub.reference-minigames-hub .chest-meter-prize strong img { width: 13px; height: 14px; }
  #app.training-hub.reference-minigames-hub .training-pass { grid-area: 3/1/4/-1; min-width: 0; flex-direction: row; align-items: center; margin: 0; gap: 10px; padding: 4px 9px; }
  #app.training-hub.reference-minigames-hub .training-pass p { font-size: 10px; line-height: 1.35; }
  #app.training-hub.reference-minigames-hub .training-pass-link { min-width: 74px; max-width: 95px; width: auto; min-height: 44px; padding: 5px 7px; font-size: 10px; white-space: normal; }
  #app.training-hub.reference-minigames-hub .minigames-grid { grid-area: 2/1/3/-1; min-height: 0; overflow-y: auto; overflow-x: hidden; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: max-content; align-content: start; align-items: stretch; gap: 9px; padding: 3px 5px 9px 3px; touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: thin; }
  #app.training-hub.reference-minigames-hub .training-card { min-height: 0; display: grid; grid-template-columns: 22% minmax(0,1fr); padding: 5px; border-image-width: 8px; }
  #app.training-hub.reference-minigames-hub .training-card-art { width: 100%; height: 100%; min-height: 164px; aspect-ratio: auto; object-fit: cover; border: 0; border-right: 1px solid var(--card-trim); }
  #app.training-hub.reference-minigames-hub .training-card-content { display: grid; grid-template-rows: auto auto auto auto auto; align-content: start; gap: 4px; min-height: 0; padding: 6px; }
  #app.training-hub.reference-minigames-hub .training-card-content h2 { gap: 5px; margin: 0; font-size: 14px; line-height: 1.2; letter-spacing: .02em; }
  #app.training-hub.reference-minigames-hub .training-card-content h2::before { flex-basis: 13px; width: 13px; height: 13px; }
  #app.training-hub.reference-minigames-hub .training-card-content p { min-height: 0; margin: 0; font-size: 11px; line-height: 1.35; }
  #app.training-hub.reference-minigames-hub .training-card-content > b { font-size: 11px; line-height: 1.3; }
  #app.training-hub.reference-minigames-hub .training-rewards { gap: 4px; margin: 0; }
  #app.training-hub.reference-minigames-hub .training-rewards > span { min-height: 0; padding: 4px 5px; font-size: 9px; line-height: 1.25; }
  #app.training-hub.reference-minigames-hub .training-card-actions { gap: 6px; margin: 0; }
  #app.training-hub.reference-minigames-hub .training-card-actions button,
  #app.training-hub.reference-minigames-hub .training-card-actions [data-mini-resume] { flex: 1 1 100%; min-height: 44px; padding: 5px; font-size: 13px; }
  #app.training-hub.reference-minigames-hub .training-hub-status { grid-area: 4/1/5/-1; font-size: 11px; }

  /* Keep the single-column service record independently scrollable. */
  #account-ranks-screen.account-ranks-screen { padding: var(--screen-insets,6px); }
  #account-ranks-screen.account-ranks-screen .ranks-panel { display: grid; height: 100%; max-height: 100%; min-height: 0; grid-template-columns: minmax(0,1fr) 84px; grid-template-rows: 44px auto minmax(0,1fr); padding: 6px 8px; gap: 5px; overflow: hidden; }
  #account-ranks-screen.account-ranks-screen .ranks-heading { grid-area: 1/1; padding: 0; border: 0; }
  #account-ranks-screen.account-ranks-screen .ranks-summary { grid-area: 2/1/3/-1; margin: 0; padding: 0 4px 5px; }
  #account-ranks-screen.account-ranks-screen .ranks-list { grid-area: 3/1/4/-1; overflow: auto; min-height: 0; max-height: none; margin: 0; padding: 4px 5px 10px; gap: 9px; grid-template-columns: minmax(0,1fr); grid-auto-rows: max-content; align-content: start; }
  #account-ranks-screen.account-ranks-screen .ranks-entry { min-height: 116px; grid-template-columns: 48px minmax(0,1fr) 36px; gap: 9px; padding: 8px 10px; border-width: 6px; }
  #account-ranks-screen.account-ranks-screen .ranks-token img { width: 48px; height: 58px; }
  #account-ranks-screen.account-ranks-screen .ranks-entry h2 { font-size: 16px; }
  #account-ranks-screen.account-ranks-screen .ranks-entry p { font-size: 12px; line-height: 1.35; margin: 4px 0 0; }
  #account-ranks-screen.account-ranks-screen .ranks-entry-number { font-size: 31px; }
  #account-ranks-screen.account-ranks-screen .ranks-meter { height: 26px; margin-block: 4px; }
  #account-ranks-screen.account-ranks-screen .ranks-meter > strong { font-size: 12px; }
  #account-ranks-screen.account-ranks-screen .ranks-panel > footer { grid-area: 1/2; position: static; padding: 0; gap: 0; border: 0; box-shadow: none; }
  #account-ranks-screen.account-ranks-screen footer p { display: none; }
  #account-ranks-screen.account-ranks-screen .ranks-back { height: 44px; min-width: 0; width: 84px; padding: 4px 8px; font-size: 12px; }

  /* Reward content precedes purchase detail on landscape mobile screens. */
  #app.daily-rewards-page.depot-flow-page .depot-flow-shell { padding: 7px 9px; gap: 6px; }
  #app.daily-rewards-page.depot-flow-page .depot-flow-shell > .depot-page-header { order: 0; height: 46px; min-height: 46px; padding: 0 5px; gap: 10px; box-sizing: border-box; }
  #app.daily-rewards-page.depot-flow-page .depot-title > span { font-size: 8px; line-height: 1.2; }
  #app.daily-rewards-page.depot-flow-page .depot-title h1 { font-size: 22px; margin: 2px 0; }
  #app.daily-rewards-page.depot-flow-page .depot-title > p { display: none; }
  #app.daily-rewards-page.depot-flow-page .rewards-back { min-height: 44px; min-width: 84px; padding: 6px 10px; font-size: 12px; }
  #app.daily-rewards-page.depot-flow-page .depot-season-info { order: 1; grid-template-columns: auto minmax(0,1fr) minmax(160px,.8fr); padding: 4px 8px; gap: 2px 8px; }
  #app.daily-rewards-page.depot-flow-page .depot-season-badge { grid-area: 1/1/3/2; padding: 3px 5px; min-width: 55px; gap: 2px; font-size: 8px; }
  #app.daily-rewards-page.depot-flow-page .depot-season-badge b { font-size: 18px; }
  #app.daily-rewards-page.depot-flow-page .reward-season { grid-area: 1/2; gap: 4px 10px; font-size: 11px; }
  #app.daily-rewards-page.depot-flow-page .depot-current-day { font-size: 10px; }
  #app.daily-rewards-page.depot-flow-page .depot-current-day b { font-size: 18px; }
  #app.daily-rewards-page.depot-flow-page .depot-expiration { grid-area: 1/3; gap: 2px; }
  #app.daily-rewards-page.depot-flow-page .depot-expiration time { font-size: 10px; }
  #app.daily-rewards-page.depot-flow-page .depot-clock-panel { grid-area: 2/2/3/4; font-size: 10px; gap: 3px 10px; }
  #app.daily-rewards-page.depot-flow-page .depot-clock-panel b { font-size: 10px; }
  #app.daily-rewards-page.depot-flow-page .reward-track-section.premium { order: 2; }
  #app.daily-rewards-page.depot-flow-page .reward-track-section.free { order: 3; }
  #app.daily-rewards-page.depot-flow-page .reward-policy-note { order: 4; font-size: 11px; }
  #app.daily-rewards-page.depot-flow-page .premium-pass-copy { order: 5; grid-template-columns: 76px minmax(0,1fr); padding: 11px; gap: 9px 12px; }
  #app.daily-rewards-page.depot-flow-page .depot-navigation { order: 6; }
  #app.daily-rewards-page.depot-flow-page .reward-status { order: 1; }
  #app.daily-rewards-page.depot-flow-page .premium-pass-copy > img { width: 76px; height: 85px; }
  #app.daily-rewards-page.depot-flow-page .premium-pass-copy h2 { font-size: 15px; }
  #app.daily-rewards-page.depot-flow-page .premium-pass-copy p { font-size: 11px; margin: 4px 0; }
  #app.daily-rewards-page.depot-flow-page .depot-pass-actions { grid-column: 1/-1; display: grid; grid-template-columns: 100px minmax(0,1fr) minmax(165px,.8fr); gap: 8px 12px; padding: 9px 0 0; border-left: 0; }
  #app.daily-rewards-page.depot-flow-page .depot-pass-price { font-size: 23px; }
  #app.daily-rewards-page.depot-flow-page .season-pass-terms summary { min-height: 44px; display: flex; align-items: center; }
  #app.daily-rewards-page.depot-flow-page .reward-track-section { padding: 8px !important; }
  #app.daily-rewards-page.depot-flow-page .depot-track-heading { gap: 8px; padding-bottom: 4px; }
  #app.daily-rewards-page.depot-flow-page .depot-track-heading h2 { font-size: 15px; }
  #app.daily-rewards-page.depot-flow-page .depot-track-heading small { display: none; }
  #app.daily-rewards-page.depot-flow-page .depot-track-controls { gap: 6px; }
  #app.daily-rewards-page.depot-flow-page .depot-track-controls .depot-center-today { min-width: 66px; font-size: 9px; }
  #app.daily-rewards-page.depot-flow-page .reward-track { padding: 7px 2px 10px; gap: 8px; align-items: stretch; }
  #app.daily-rewards-page.depot-flow-page :is(.premium,.free) .reward-day { display: grid; grid-template-columns: 48px minmax(0,1fr); grid-template-rows: 16px minmax(54px,auto) 44px; align-items: center; align-content: start; flex: 0 0 170px; height: auto; min-height: 146px; padding: 8px; gap: 5px; box-sizing: border-box; }
  #app.daily-rewards-page.depot-flow-page .reward-day-label { grid-area: 1/1/2/-1; text-align: center; font-size: 11px; }
  #app.daily-rewards-page.depot-flow-page .premium :is(.reward-armored-container,.reward-crystal-group),
  #app.daily-rewards-page.depot-flow-page .free .reward-free-crate { grid-area: 2/1; width: 48px; height: 48px; margin: 0; }
  #app.daily-rewards-page.depot-flow-page .premium .reward-armored-container img { width: 48px; max-height: 48px; }
  #app.daily-rewards-page.depot-flow-page .premium .reward-crystal-group { display: block; }
  #app.daily-rewards-page.depot-flow-page .premium .reward-armored-container + .reward-crystal-group { display: none; }
  #app.daily-rewards-page.depot-flow-page .reward-day .reward-amounts { grid-area: 2/2; font-size: 11px; line-height: 1.3; gap: 4px; margin: 0; }
  #app.daily-rewards-page.depot-flow-page .reward-currency-line { justify-content: flex-start; gap: 4px; }
  #app.daily-rewards-page.depot-flow-page .reward-currency-line img { width: 17px; height: 19px; flex-basis: 17px; }
  #app.daily-rewards-page.depot-flow-page .premium .reward-day [data-reward-currency="cash"] { min-height: 20px; }
  #app.daily-rewards-page.depot-flow-page .premium .reward-day [data-reward-currency="cash"] > img { width: 26px; height: 20px; flex-basis: 26px; }
  #app.daily-rewards-page.depot-flow-page .reward-day button { grid-area: 3/1/4/-1; min-height: 44px; margin: 0; font-size: 10px; }
  #app.daily-rewards-page.depot-flow-page .reward-previous-schedule { grid-row: 4; grid-column: 1/-1; }
  #app.daily-rewards-page.depot-flow-page .reward-day:has(.reward-previous-schedule) { grid-template-rows: auto minmax(54px,auto) 44px auto; }
}

@media (orientation: landscape) and (max-height: 700px) and (min-width: 960px) and (max-width: 1400px) {
  #app.menu-bg .mission-archive .campaign-section .missions-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #app.reference-store.store-page :is(.cash-products,.ruby-products,.exchange-grid) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #app.training-hub.reference-minigames-hub .training-card { grid-template-columns: 34% minmax(0,1fr); }
  #app.training-hub.reference-minigames-hub .training-card-art { min-height: 185px; }
  #app.training-hub.reference-minigames-hub .training-card-content { padding: 10px; }
  #app.training-hub.reference-minigames-hub .training-card-content h2 { font-size: 16px; }
  #app.training-hub.reference-minigames-hub .training-card-content p { font-size: 12px; }
}
