/* Final mobile layer. Input fields and scrolling lists keep native gestures. */
html[data-mobile-shell="true"] {
 --mobile-bottom: max(0px,calc(100dvh - var(--mobile-viewport-height,100dvh) - var(--mobile-viewport-top,0px)));
}
html[data-mobile-shell="true"] :is(#court,#game,.game-modal-layer,.account-layer) {
 top:var(--mobile-viewport-top,0px); bottom:auto; height:var(--mobile-viewport-height,100dvh);
}
html[data-mobile-shell="true"] :is(#view,#joystick,#touch-interact,#game button,#modals button) {
 user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation;
}
html[data-mobile-shell="true"] #joystick {touch-action:none;width:120px;height:120px}
html[data-mobile-shell="true"] #touch-movement {
 position:fixed;left:max(12px,env(safe-area-inset-left));bottom:calc(var(--mobile-bottom) + max(12px,env(safe-area-inset-bottom)));pointer-events:none;
}
html[data-mobile-shell="true"] #touch-interact {
 position:fixed;left:auto;top:auto;right:max(12px,env(safe-area-inset-right));bottom:calc(var(--mobile-bottom) + max(16px,env(safe-area-inset-bottom)));
 min-width:88px;min-height:56px;height:56px;width:auto;padding-inline:14px;pointer-events:auto;
}
html[data-mobile-shell="true"] :is(#touch-movement,#touch-interact,#joystick)[hidden]{display:none!important}
html[data-mobile-shell="true"] #mobile-rotate[open]{
 inset:var(--mobile-viewport-top,0px) 0 auto;height:var(--mobile-viewport-height,100dvh);
 padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))!important;
}
html[data-mobile-shell="true"] #mobile-rotate .prompt-document {
 width:min(100%,420px);height:auto;text-align:center;
}
html[data-mobile-shell="true"] #mobile-rotate .document-title {padding-inline:0}

/* V6 frameless title · phone landscape (667×375 … 932×430): one screen, no overflow. */
html[data-mobile-shell="true"] #title {top:var(--mobile-viewport-top,0px);bottom:auto;height:var(--mobile-viewport-height,100dvh)}
@media (max-height: 500px) {
 html[data-mobile-shell="true"] .v6-title {padding:max(27px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
 html[data-mobile-shell="true"] .v6-title-lockup {gap:2px}
 html[data-mobile-shell="true"] .v6-title .v6-title-name {font-size:clamp(26px,7.4vh,34px);letter-spacing:3px;filter:drop-shadow(0 2px 0 #170c04) drop-shadow(1px 0 0 #2a1607) drop-shadow(0 0 10px rgba(255,196,92,.24))}
 html[data-mobile-shell="true"] .v6-title .v6-title-sub {font-size:11px;letter-spacing:3px}
 html[data-mobile-shell="true"] .v6-gem-zone {margin-top:clamp(10px,3.6vh,18px);gap:6px}
 html[data-mobile-shell="true"] .v6-title .v6-gem-rail {padding:4px 8px}
 html[data-mobile-shell="true"] .v6-gem-hint {font-size:16px;letter-spacing:.65px}
 html[data-mobile-shell="true"] .v6-title-actions {gap:4px}
 html[data-mobile-shell="true"] .v6-title .avalon-button.v6-title-enter {width:220px!important;min-height:44px!important;font-size:18px!important;letter-spacing:5px;text-indent:5px}
 html[data-mobile-shell="true"] .v6-title .avalon-button.v6-title-enter[data-busy="true"] {font-size:15px!important;letter-spacing:2px;text-indent:2px}
 html[data-mobile-shell="true"] .v6-title-links {min-height:28px;font-size:13px;gap:2px}
 html[data-mobile-shell="true"] .v6-title .avalon-link.v6-title-link {padding:6px 8px!important;letter-spacing:1px}
 html[data-mobile-shell="true"] .v6-title-status {font-size:12px}
 html[data-mobile-shell="true"] .rw-reveal > .rw-dev-gift-note {width:min(440px,calc(100% - 24px));padding:6px 12px 7px 8px;gap:8px}
 html[data-mobile-shell="true"] .rw-dev-gift-crest {width:30px;height:30px}
 html[data-mobile-shell="true"] .rw-dev-gift-title {font-size:13px;letter-spacing:1px}
 html[data-mobile-shell="true"] .rw-dev-gift-body {font-size:11px;line-height:1.45}
 html[data-mobile-shell="true"] .game-document.v6-bind-prompt {gap:8px}
 html[data-mobile-shell="true"] .v6-bind-card {padding:10px 14px;gap:8px}
 html[data-mobile-shell="true"] .v6-bind-chest {width:30px;height:30px}
 html[data-mobile-shell="true"] .v6-bind-copy {font-size:14px!important;line-height:1.55!important}
 html[data-mobile-shell="true"] .v6-title .avalon-link.v6-title-link {min-height:44px!important;display:inline-flex;align-items:center}
 html[data-mobile-shell="true"] .collection-document .v4-collection-bar {gap:6px;flex-wrap:nowrap}
 html[data-mobile-shell="true"] .collection-document .collection-tabs {padding:2px!important;gap:2px!important}
 html[data-mobile-shell="true"] .collection-document .collection-tabs > button {padding:0 8px!important;font-size:12.5px!important;min-height:30px!important}
 html[data-mobile-shell="true"] .collection-document .v4-wallet {gap:6px}
 html[data-mobile-shell="true"] .collection-document .v4-wallet-badge {min-width:0!important;padding:0 8px 0 4px!important;height:28px!important}
 html[data-mobile-shell="true"] .collection-document .v4-wallet-badge .resource-amount {gap:4px!important;font-size:15px!important}
 html[data-mobile-shell="true"] .collection-document .v4-wallet-badge .resource-icon {width:20px!important;height:20px!important}
 html[data-mobile-shell="true"] .collection-document .v4-rarity-bar {gap:6px!important;flex-wrap:nowrap!important;overflow-x:auto!important;scrollbar-width:none}
 html[data-mobile-shell="true"] .collection-document .v4-rarity-bar::-webkit-scrollbar {display:none}
 html[data-mobile-shell="true"] .collection-document .v4-rarity-filters,
 html[data-mobile-shell="true"] .collection-document .v4-sort-pills {flex:0 0 auto!important;overflow:visible!important;max-width:none!important}
 html[data-mobile-shell="true"] .collection-document .v4-rarity-bar .avalon-button[data-variant="pill"] {padding:0 7px!important;font-size:12px!important;gap:4px!important}
}
@media (max-height: 400px) {
 html[data-mobile-shell="true"] .v6-title {padding-top:max(22px,env(safe-area-inset-top));padding-bottom:max(20px,env(safe-area-inset-bottom))}
 html[data-mobile-shell="true"] .v6-gem-zone {margin-top:6px;gap:4px}
 html[data-mobile-shell="true"] .v6-title-links {min-height:32px}
 html[data-mobile-shell="true"] .v6-title .avalon-link.v6-title-link {min-height:36px!important;padding:4px 8px!important}
}

/* V6 diegetic lobby entry plaques · phone landscape (667×375 … 932×430) */
@media (max-width: 960px), (max-height: 500px) {
 html[data-mobile-shell="true"] #game[data-stage="menu"] .game-toolbar.v4-toolbar {
  top:max(8px,env(safe-area-inset-top))!important;
  left:max(10px,env(safe-area-inset-left))!important;
  right:max(10px,env(safe-area-inset-right))!important;
 }
 html[data-mobile-shell="true"] .v4-menu-topleft {gap:5px!important}
 html[data-mobile-shell="true"] .v4-feature-entries {width:196px!important;gap:5px!important}
 html[data-mobile-shell="true"] .avalon-button.v4-feature-entry.v6-diegetic-plaque {
  height:44px!important;min-height:44px!important;padding:4px 8px!important;gap:6px!important;border-radius:5px!important;
 }
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v4-entry-icon-wrap {width:26px!important;height:26px!important;border-radius:4px!important}
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v4-entry-icon-wrap > svg.pixel-icon {width:17px!important;height:17px!important}
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v4-entry-copy {gap:1px!important;min-width:0!important}
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v4-entry-title {font-size:12.5px!important;line-height:1.15!important}
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v4-entry-sub {
  display:block!important;font-size:10.5px!important;line-height:1.18!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v6-star-crest {width:13px!important;height:19px!important;flex:0 0 13px!important}
}
@media (max-width: 720px) {
 html[data-mobile-shell="true"] .v4-feature-entries {width:176px!important}
 html[data-mobile-shell="true"] .avalon-button.v4-feature-entry.v6-diegetic-plaque {padding:4px 7px!important;gap:5px!important}
 html[data-mobile-shell="true"] .v6-diegetic-plaque .v4-entry-sub {font-size:10px!important}
}
/* Preserve both 44px plaque targets and clear the center actions from the left rail. */
@media (min-width: 640px) and (max-width: 720px) and (max-height: 430px) and (orientation: landscape) {
 html[data-mobile-shell="true"] #game[data-stage="menu"] .v4-main-menu .v4-menu-stage {
  width:min(332px, calc(100vw - 388px))!important;
 }
}
@media (max-width: 960px), (max-height: 500px) {
 html[data-mobile-shell="true"] .avalon-button.v4-feature-entry.v6-diegetic-plaque[data-diegetic-state="active"] {padding-block:1px!important}
 html[data-mobile-shell="true"] .v6-diegetic-plaque[data-diegetic-state="active"] .v4-entry-sub {
  display:-webkit-box!important;white-space:normal!important;text-overflow:clip!important;
 }
}

/* Phase-two prompts: maintain a single action row in short horizontal layouts. */
html[data-mobile-shell="true"] .rewards-document .rw-result-actions[data-result-layout]{
 --rw-result-action-height:44px;--rw-result-action-gap:8px;
 --rw-result-action-padding:0 5px;--rw-result-action-font:13px;--rw-result-action-letter-spacing:0;
 inline-size:min(100%,390px);
}
html[data-mobile-shell="true"] .rewards-document .rw-result-actions[data-result-layout="try-on-three"]{
 --rw-result-columns:minmax(0,1fr) minmax(0,1.45fr) minmax(0,1fr);
}
html[data-mobile-shell="true"] .rewards-document .rw-result-actions[data-result-layout="try-on-two"]{
 --rw-result-columns:repeat(2,minmax(0,1fr));
}
html[data-mobile-shell="true"] .collection-tabs .phase-two-diamond{
 inset-block-start:2px;inset-inline-end:3px;
}
html[data-mobile-shell="true"] .rw-reveal-skip-dock{
 top:max(8px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));
}
html[data-mobile-shell="true"] .rw-reveal-skip-dock .rw-reveal-skip{min-height:44px;min-width:44px}
html[data-mobile-shell="true"] .phase-two-wardrobe-slot-unread .phase-two-diamond{inset-block-start:2px;inset-inline-end:2px}

html[data-mobile-shell="true"] .cosmetics-document .cosmetics-tabs .phase-two-diamond{
 inset-block-start:2px;inset-inline-end:3px;
}

/* Replace the pre-v9 two-column short-screen layout with one centered reward stack. */
html[data-mobile-shell="true"] .economy-document.rewards-document .rw-result-stage.v9-result{
 grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);
 gap:0;padding:8px max(12px,env(safe-area-inset-right)) 114px max(12px,env(safe-area-inset-left));
}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card{
 grid-area:1/1;min-width:0;width:min(100%,520px);max-height:100%;gap:4px;padding:0 8px;
}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card .rw-result-display{
 min-height:0;height:clamp(68px,calc(100dvh - 224px),150px);max-width:100%;
}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card .rw-result-display :is(.wardrobe-part-art,.cosmetic-character-render,.rw-result-coins){
 height:100%;max-height:100%;width:auto;aspect-ratio:1;
}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card .rw-result-display>.dynamic-nameplate{
 max-height:100%;width:min(100%,calc(clamp(68px,100dvh - 224px,150px) * 3.3));
}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card .rw-result-quality.v4-rarity{
 font-size:14px;line-height:1.15;padding-block:3px;letter-spacing:1px;
}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card .rw-result-title{font-size:22px;line-height:1.12;letter-spacing:0}
html[data-mobile-shell="true"] .economy-document.rewards-document .v9-result-card .rw-result-description{font-size:13px;line-height:1.15;padding:3px 8px}


html[data-mobile-shell="true"] .economy-document.rewards-document .rw-result-stage.v9-result>.rw-standby-actions{
 bottom:max(28px,calc(env(safe-area-inset-bottom) + 10px));gap:8px;
}

/* Retain the restored row height; shorten only the gaps on narrow landscape. */
html[data-mobile-shell="true"] .treasury-catalog .treasury-tier > summary{
 gap:4px;padding-inline:8px;
}
html[data-mobile-shell="true"] .treasury-catalog .treasury-tier > summary .v4-chip{padding-inline:6px}
html[data-mobile-shell="true"] .treasury-catalog .treasury-tier > summary .v4-rarity{padding-inline:5px}

/* Wave 3A: mobile identity editor keeps room settings pinned beside the scrollable roles. */
@media (orientation: landscape) and (max-height: 500px) {
 html[data-mobile-shell="true"] #modals .game-modal-layer:has(> :is(.v4-identity-workbench,.v4-candidates-dialog,.v4-adjust-dialog)) {
  box-sizing:border-box;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))!important;
 }
 html[data-mobile-shell="true"] #modals .game-document:is(.v4-identity-workbench,.v4-candidates-dialog) {
  box-sizing:border-box;zoom:1!important;width:100%!important;max-width:100%!important;
  height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important;
  padding:12px!important;gap:8px!important;
 }
 html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench {
  --mobile-role-rail:clamp(195px,32vw,225px);
  display:grid!important;grid-template-columns:var(--mobile-role-rail) minmax(0,1fr);
  grid-template-rows:44px auto auto minmax(0,1fr) auto;
  gap:8px 12px!important;align-items:stretch;align-content:stretch;
 }
 html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .document-title {
  grid-area:1/1;display:grid;place-items:center;
  min-height:0!important;height:44px;margin:0!important;padding:0 4px 4px!important;
  font-size:22px!important;line-height:1.1;white-space:nowrap;
 }
 html[data-mobile-shell="true"] #modals .game-document:is(.v4-identity-workbench,.v4-candidates-dialog,.v4-adjust-dialog) > .document-close {
  top:10px!important;right:10px!important;min-width:44px!important;width:44px!important;
  min-height:44px!important;height:44px!important;max-height:44px!important;padding:0!important;z-index:3;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .role-deck-summary {
  grid-area:2/1;display:grid;grid-template-columns:1fr 1fr;gap:4px 8px;
  min-width:0;max-width:none;margin:0!important;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .role-deck-summary .v4-faction-tag {
  min-width:0!important;max-width:none;padding:2px 4px!important;white-space:nowrap;font-size:12px!important;line-height:1.2;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .role-deck-summary .v4-balance-meter {
  grid-area:2/1/3/3;min-height:18px;height:18px;margin:0!important;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .role-deck-summary .v4-balance-cap {font-size:10px!important;letter-spacing:0}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .role-deck-feedback {
  grid-area:3/1/5/2;align-self:center;max-width:100%;min-height:0;margin:0!important;padding:0 3px;
  text-align:center;font-size:12px!important;line-height:1.3;overflow-wrap:anywhere;
 }
 html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .role-deck-scroll {
  grid-area:1/2/-1/3;margin:48px 0 0!important;min-height:0;min-width:0;
  padding:0 4px 6px!important;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;gap:10px;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-deck-columns {display:flex;flex-direction:column;gap:10px}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-faction-sheet {padding:6px 10px 10px!important;gap:6px}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-faction-sheet > .role-deck-faction {font-size:15px!important}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-faction-sheet > .role-deck-row {
  grid-template-columns:repeat(3,minmax(0,1fr));gap:8px!important;padding:2px 0!important;overflow:visible;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot {gap:8px!important;max-width:none}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot .court-card {
  width:min(100%,86px)!important;max-width:100%;height:auto!important;aspect-ratio:216/332;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot > .avalon-button {
  min-width:44px!important;min-height:44px!important;height:44px!important;padding:0 4px!important;
  font-size:13px!important;white-space:nowrap;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .v4-identity-footer {
  grid-area:5/1;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(3,minmax(44px,auto));
  padding-top:8px;gap:8px;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .v4-identity-footer > .avalon-paired {display:contents!important}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-identity-footer .avalon-button {
  grid-column:1;width:100%!important;min-width:44px!important;min-height:44px!important;height:44px!important;
  padding:0 6px!important;font-size:14px!important;box-sizing:border-box;
 }
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-identity-footer .avalon-paired > .avalon-button:first-child {grid-row:1}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-identity-footer > .role-deck-reset {grid-row:2}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-identity-footer .avalon-paired > .avalon-button:last-child {grid-row:3}
 html[data-mobile-shell="true"] #modals .v4-identity-workbench > .avalon-button:not(.document-close) {
  grid-area:5/1;min-height:44px!important;
 }

 /* Compact stamped header and a true, independently scrollable role picker. */
 html[data-mobile-shell="true"] #modals .game-document.v4-candidates-dialog {
  display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:36px auto minmax(0,1fr) 44px;gap:6px!important;
  align-items:stretch;align-content:stretch;
 }
 html[data-mobile-shell="true"] #modals .game-document.v4-candidates-dialog > .document-title {
  margin:0!important;padding:2px 54px 4px!important;line-height:1.12;
  min-height:36px!important;height:36px;display:grid;place-items:center;font-size:20px!important;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog > .v4-candidate-banner {
  gap:6px 8px;padding:3px 8px;justify-content:flex-start;line-height:1.2;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-hint {font-size:12px;flex:1;min-width:175px;text-align:left}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-banner > .v4-faction-tag {
  padding:2px 6px;font-size:12px;white-space:nowrap;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog > .v4-candidate-gallery {
  grid-template-columns:repeat(2,minmax(0,1fr));min-height:0;min-width:0;
  gap:8px;padding:2px 3px 6px;overscroll-behavior:contain;touch-action:pan-y;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-card {
  grid-template-columns:min(76px,24%) minmax(0,1fr);gap:8px;padding:7px!important;min-width:0;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-art .court-card {
  width:100%!important;height:auto!important;aspect-ratio:216/332;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-copy {gap:4px}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-plan-box {padding:3px 5px;gap:3px}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-plan-note {display:block;line-height:1.25!important;font-size:11px!important}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-plan-note .v4-plan-chip {display:inline;padding:1px 3px;font-size:10px}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-name {font-size:16px;line-height:1.15}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-desc {font-size:12px!important;line-height:1.3!important}
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-copy > .avalon-button {
  width:100%!important;min-width:44px!important;min-height:44px!important;height:44px!important;
  padding:0 4px!important;margin:0;font-size:13px!important;white-space:nowrap;
 }
 html[data-mobile-shell="true"] #modals .v4-candidates-dialog > .v4-candidate-footer {padding-top:0}
 html[data-mobile-shell="true"] #modals :is(.v4-candidate-footer,.v4-adjust-footer) .avalon-button {min-height:44px!important}
}
@media (orientation: landscape) {
 html[data-mobile-shell="true"] {
  --workbench-height: calc(min(100dvh, var(--mobile-viewport-height, 100dvh)) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);
 }
 html[data-mobile-shell="true"] #modals .cosmetics-document {
  display:flex!important; flex-direction:column; box-sizing:border-box; zoom:1!important;
  height:var(--workbench-height)!important; max-height:var(--workbench-height)!important; min-height:0!important;
  padding:6px 10px!important; gap:4px!important;
 }
 html[data-mobile-shell="true"] #modals .cosmetics-content {flex:1 1 0;min-height:0!important;overflow-y:auto!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document :is(.document-title,.cosmetics-tabs,.cosmetics-footer){flex:none!important;margin-block:0!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document :is(.document-close,.cosmetics-tabs button,.cosmetics-footer button){height:44px!important;min-height:44px!important;min-width:44px!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-preview-hint{display:none!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-search{font-size:16px!important}
 html[data-mobile-shell="true"] #modals .v5-basics-info{height:auto!important;min-height:max-content!important}
 html[data-mobile-shell="true"] #modals .v5-basics-info-row{display:flex!important;flex-direction:column;align-items:stretch!important;gap:4px}
 html[data-mobile-shell="true"] #modals .v5-name-field{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:6px;width:100%!important}
 html[data-mobile-shell="true"] #modals .v5-name-input{display:flex!important;align-items:center;min-width:0;gap:4px}
 html[data-mobile-shell="true"] #modals .v5-name-input input{width:0!important;min-width:0!important;flex:1;font-size:16px!important}
 html[data-mobile-shell="true"] #modals .v5-name-counter{position:static!important}
 html[data-mobile-shell="true"] #modals .treasury-hero{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr) 44px;gap:2px 4px!important;padding:4px!important;min-height:0!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-section-title{grid-column:1/-1;margin:0}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-stage{height:100%!important;min-height:0!important;max-height:80px!important;align-self:center}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-treasury-supply-bar{display:flex!important;flex-direction:column;align-self:center;gap:1px;padding:0}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-actions{grid-column:1/-1;margin:0!important;padding:0!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-cta{height:44px!important;min-height:44px!important;margin:0!important}
 html[data-mobile-shell="true"] #accounts .account-panel:has(.account-form){box-sizing:border-box;zoom:1!important;width:min(640px,96vw)!important;height:auto!important;min-height:0!important;max-height:var(--workbench-height)!important;overflow-y:auto!important;overscroll-behavior:contain;padding:6px 12px!important;display:block!important}
 html[data-mobile-shell="true"] #accounts .account-panel:has(.account-form) :is(h1,p){margin:2px 0!important;padding-block:0!important}
 html[data-mobile-shell="true"] #accounts .account-form .v4-form-well{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px!important;padding:4px!important}
 html[data-mobile-shell="true"] #accounts .account-form .account-field{margin:0!important;gap:1px!important}
 html[data-mobile-shell="true"] #accounts .account-form input{height:36px!important;min-height:36px!important;font-size:16px!important}
 html[data-mobile-shell="true"] #accounts .account-form .avalon-paired{margin:4px 0!important}
 html[data-mobile-shell="true"] #accounts .account-form button{min-height:44px!important}
}
@media (orientation:landscape) {
 html[data-mobile-shell="true"] #modals dialog:has(.cosmetics-document){display:grid!important;place-items:center!important;padding:0!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document>.document-title{position:static!important;line-height:24px!important;min-height:24px!important}
 html[data-mobile-shell="true"] #modals .wardrobe-basics.v5-basics{display:flex!important;flex-direction:column;align-items:stretch!important}
 html[data-mobile-shell="true"] #modals .wardrobe-basics.v5-basics>*{flex:none;min-width:0}
 html[data-mobile-shell="true"] #modals .v5-name-input input{padding-inline:8px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-stage{width:100%!important;min-width:0!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-stage>*{max-width:100%!important;max-height:100%!important}
}
/* Mobile workbench composition. Desktop and match controls use their existing layout. */
@media (orientation: landscape) {
 html[data-mobile-shell="true"] #accounts .account-form .v4-form-well {
  align-items: start;
 }
 html[data-mobile-shell="true"] #accounts .account-field:has(input[name="password"]) {
  grid-area: 1 / 2;
 }
 html[data-mobile-shell="true"] #accounts .account-field:has(input[name="email"]) {
  grid-area: 2 / 1 / auto / -1;
 }
 html[data-mobile-shell="true"] #accounts .v4-form-well > .avalon-link {
  grid-area: 1 / 2; justify-self:end; align-self:start; z-index:1;
  margin:0!important; padding:0 4px!important; min-height:24px; line-height:24px;
 }
 html[data-mobile-shell="true"] #modals .cosmetics-footer {
  display:flex!important; align-items:end; gap:8px!important; justify-content:space-between;
 }
 html[data-mobile-shell="true"] #modals .cosmetics-footer :is(.v5-cosmetics-footer-left,.avalon-paired) {
  display:flex!important; width:auto!important; gap:8px!important; align-items:end;
 }
 html[data-mobile-shell="true"] #modals .cosmetics-footer > .avalon-paired {margin-inline-start:auto!important}
 html[data-mobile-shell="true"] #modals .cosmetics-footer .avalon-paired > [data-variant="primary"] {
  width:112px!important; min-width:112px!important; max-width:112px!important; container-type:inline-size;
 }
 @container (width < 140px) {
  html[data-mobile-shell="true"] #modals .cosmetics-footer .avalon-button[data-variant="primary"]::before,
  html[data-mobile-shell="true"] #modals .cosmetics-footer .avalon-button[data-variant="primary"]::after {content:none!important;display:none!important}
 }
 html[data-mobile-shell="true"] #modals .cosmetics-document:has(.wardrobe-sets) {gap:2px!important;padding-block:4px!important}
 html[data-mobile-shell="true"] #modals .wardrobe-browse-mode .wardrobe-detail[data-detail-kind="set"] {
  padding:2px 6px!important;gap:2px!important;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-browse-mode:has(.wardrobe-sets) .wardrobe-detail-heading {
  min-height:22px!important;margin:0!important;line-height:1.15;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-browse-mode .wardrobe-grid.wardrobe-sets {
  grid-auto-rows:88px!important; padding:4px!important;min-height:100px!important;gap:6px!important;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-sets .wardrobe-item.avalon-button {
  height:88px!important;min-height:88px!important;max-height:88px!important;grid-template-rows:42px 18px 14px!important;gap:1px!important;padding:3px 4px!important;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-sets .wardrobe-item-picture,
 html[data-mobile-shell="true"] #modals .wardrobe-sets .wardrobe-item-picture canvas {height:42px!important;min-height:0!important;max-height:42px!important}
 html[data-mobile-shell="true"] #modals .wardrobe-sets .wardrobe-item-name {min-height:18px!important;height:18px!important;line-height:18px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero {
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto 44px;justify-items:center;text-align:center;
 }
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-section-title {width:100%;text-align:center!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-treasury-supply-bar {flex-direction:row;align-items:center;justify-content:center;gap:6px}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-stage {display:grid;place-items:center;max-height:78px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-actions {width:100%}
}
@media (orientation: landscape) {
 html[data-mobile-shell="true"] #modals .v4-wardrobe-browser:has(.wardrobe-sets) {
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(100px,1fr) auto!important;gap:4px!important;min-height:0!important;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-detail[data-detail-kind="set"] {height:auto!important;max-height:60px!important;overflow-y:auto!important}
 html[data-mobile-shell="true"] #modals .wardrobe-detail[data-detail-kind="set"] :is(h4,p) {margin-block:0!important;line-height:16px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-stage {padding:0;grid-template: minmax(0,1fr) / minmax(0,1fr)}
 html[data-mobile-shell="true"] #modals .treasury-hero .treasury-chest {height:min(100%,54px)!important;width:auto!important;aspect-ratio:130/84}
}
@media (orientation:landscape) {
 html[data-mobile-shell="true"] #modals .wardrobe-workspace {
  grid-template-columns:clamp(136px,22vw,196px) minmax(0,1fr)!important;column-gap:8px!important;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-workspace:has(.mobile-wardrobe-parts)[data-mode="wardrobe"] {
  grid-template-rows:42px minmax(0,1fr)!important;row-gap:3px!important;
 }
 html[data-mobile-shell="true"] #modals .wardrobe-preview {grid-column:1;grid-row:1/-1;min-width:0}
 html[data-mobile-shell="true"] #modals .wardrobe-controls {grid-column:2;min-width:0}
 html[data-mobile-shell="true"] #modals .wardrobe-equipment-stage {display:flex!important;align-items:center;justify-content:center;}
 html[data-mobile-shell="true"] #modals .wardrobe-equipment-stage :is(.equipment-column,.equipment-top),html[data-mobile-shell="true"] #modals .wardrobe-workspace:not([data-mode="wardrobe"]) .mobile-wardrobe-parts {display:none!important}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts {grid-column:2;grid-row:1;display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;touch-action:pan-x;scrollbar-width:none}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-slot.avalon-button {
  position:relative!important;inset:auto!important;display:inline-flex!important;flex:0 0 auto!important;flex-direction:row;align-items:center;justify-content:center;gap:4px;
  width:auto!important;min-width:56px!important;height:40px!important;min-height:40px!important;max-height:40px!important;
  padding:0 9px!important;white-space:nowrap;transform:none!important;
 }
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-slot > :not(.equipment-label):not(.phase-two-diamond){display:none!important}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-label{display:block!important;position:static!important;width:auto!important;height:auto!important;font-size:14px!important;line-height:20px!important;white-space:nowrap}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts [data-worn="true"] .equipment-label::before {content:'';display:inline-block;width:5px;height:5px;margin-right:4px;vertical-align:middle;background:currentColor}
 html[data-mobile-shell="true"] #modals .v4-wardrobe-rarity-bar .v4-rarity-pills{display:none!important}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-quality{display:block!important;width:70px!important;height:36px!important;min-height:36px!important;padding:2px 6px!important;font-size:14px!important}
 html[data-mobile-shell="true"] #modals .wardrobe-browse-mode .wardrobe-search{height:36px!important;min-height:36px!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document:has(.mobile-wardrobe-parts)>.document-title{position:absolute!important;left:14px!important;right:auto!important;top:13px!important;max-width:22%;font-size:18px!important}
 html[data-mobile-shell="true"] #modals .cosmetics-document:has(.mobile-wardrobe-parts)>.cosmetics-tabs{padding-block:0!important}
 html[data-mobile-shell="true"] #modals .wardrobe-browse-mode .v4-wardrobe-browser{grid-template-columns:minmax(0,1fr)!important;min-width:0}
 html[data-mobile-shell="true"] #modals .wardrobe-browse-mode .v4-wardrobe-top-bar{min-height:36px!important;padding:0!important}
}
@media (orientation:landscape) {
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-slot::after,
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-slot::before {content:none!important;display:none!important}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-slot[aria-pressed="true"] {background:var(--v4-walnut)!important;border-color:var(--v4-gold-deep)!important}
 html[data-mobile-shell="true"] #modals .mobile-wardrobe-parts .equipment-slot[aria-pressed="true"] .equipment-label {color:var(--v4-parch-hi)!important;font-weight:bold}
}

/* Wave 5: use the existing settings fields, segmented controls and card buttons. */
html[data-mobile-shell="true"] :is(#title button, #accounts button, #accounts a.avalon-link) {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

@media (orientation: landscape) {
  html[data-mobile-shell="true"] #modals .v4-settings-dialog {
    padding-block: 8px !important;
    gap: 5px !important;
  }
  html[data-mobile-shell="true"] #modals .v4-settings-dialog .settings-body {
    gap: 8px !important;
    overscroll-behavior-y: contain;
  }
  html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .v4-setting-row {
    display: grid !important;
    grid-template-columns: minmax(100px, 1fr) minmax(130px, 1.4fr);
    align-items: center;
    gap: 8px;
    padding: 4px 12px !important;
    text-align: left;
  }
  html[data-mobile-shell="true"] #modals .native-graphics .v4-setting-row legend {
    float: left;
    margin: 0 !important;
  }
  html[data-mobile-shell="true"] #modals .native-graphics :is(.settings-fullscreen, .mobile-graphics-field select) {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    min-width: 0;
    font-size: 16px !important;
  }
  html[data-mobile-shell="true"] #modals .v4-settings-dialog .settings-save-status:empty {
    display: none;
  }
  html[data-mobile-shell="true"] #modals :is(.v4-settings-tabs, .collection-tabs, .v4-seat-pills, .receipt-pagination) {
    gap: 8px !important;
  }
  html[data-mobile-shell="true"] #modals :is(.v4-settings-tabs, .collection-tabs, .v4-seat-pills, .economy-receipt, .receipt-pagination, .collection-document > .economy-actions) > button {
    min-width: 44px !important;
    min-height: 44px !important;
    margin-inline: 0 !important;
  }
  html[data-mobile-shell="true"] #modals .v4-seat-pills {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  html[data-mobile-shell="true"] #modals .v4-seat-pills > button {
    width: 100% !important;
  }
  html[data-mobile-shell="true"] #game-connection button {
    flex-shrink: 0;
    min-height: 44px !important;
  }

  html[data-mobile-shell="true"] #game .game-hud .v4-room-list {
    gap: 8px;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }
  /* The list starts below the 44px room code and its 6px gutter. */
  html[data-mobile-shell="true"] body:has(#touch-movement:not([hidden]) #joystick:not([hidden])) #game .game-hud .v4-room-list {
    max-height: calc(var(--mobile-viewport-height, 100dvh) - max(12px, env(safe-area-inset-top)) - 44px - 6px - 8px - 120px - max(12px, env(safe-area-inset-bottom)));
  }

  html[data-mobile-shell="true"] #modals .collection-grid.v4-well {
    --item-name-line: 15px;
    --item-name-space: 1px;
    --item-name-min: 32px;
    --mobile-card-art: clamp(34px, calc(100dvh - 341px), 68px);
    grid-auto-rows: max-content;
    padding: 4px;
  }
  html[data-mobile-shell="true"] #modals .collection-grid .collection-item {
    grid-template-rows: var(--mobile-card-art) minmax(var(--item-name-min), auto);
    min-height: 0;
    padding: 4px !important;
    gap: 2px;
  }
  html[data-mobile-shell="true"] #modals .collection-grid .collection-art {
    height: var(--mobile-card-art) !important;
    min-height: 0;
  }
  html[data-mobile-shell="true"] #modals .collection-grid .collection-art > * {
    max-height: var(--mobile-card-art) !important;
    object-fit: contain;
  }

  /* The action dock itself shrink-wraps. Give the grid a definite viewport-bounded width. */
  html[data-mobile-shell="true"] #modals .rw-result-actions[data-result-layout] {
    width: clamp(280px, 45vw, 390px);
  }

  html[data-mobile-shell="true"] .rewards-document .rw-result-actions:not([data-result-layout]) > .avalon-button {
    box-sizing: border-box;
    height: 54px !important;
    min-height: 54px !important;
    margin-block: 0 !important;
  }
  /* Query each button's own content box for its pseudo-elements. These controls
     have explicit widths or stretch in fixed grid tracks, so containment preserves layout. */
  html[data-mobile-shell="true"] :is(.trickster-preset-buttons, .rw-result-actions[data-result-layout]) > .avalon-button {
    container-type: inline-size;
  }
  @container (width < 140px) {
    html[data-mobile-shell="true"] :is(.trickster-preset-buttons, .rw-result-actions[data-result-layout]) > .avalon-button::before,
    html[data-mobile-shell="true"] :is(.trickster-preset-buttons, .rw-result-actions[data-result-layout]) > .avalon-button::after {
      content: none !important;
      display: none !important;
    }
  }
}


@media (orientation: landscape) {
  html[data-mobile-shell="true"] #modals .rw-result-stage[data-kind="coins"] .rw-result-display {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }
  html[data-mobile-shell="true"] #modals .rewards-document .rw-result-display .rw-result-coins {
    display: grid;
    grid-template-columns: repeat(5, 20px);
    justify-content: center;
    align-content: center;
    justify-items: center;
    width: 140px;
    height: 56px;
    flex: none;
    aspect-ratio: auto;
  }
  html[data-mobile-shell="true"] #modals .rw-result-coins > .resource-icon {
    grid-row: 1;
    width: 44px;
    height: 44px;
  }
  html[data-mobile-shell="true"] #modals .rw-result-coins > :is(:first-child, :last-child) { translate: 0 5px; }
  html[data-mobile-shell="true"] #modals .rw-result-coins > :nth-child(3) { z-index: 1; }
  html[data-mobile-shell="true"] #modals .rw-result-amount {
    position: static;
    font-size: 20px;
    line-height: 1.2;
  }

  html[data-mobile-shell="true"] #modals .weekly-card.v4-pedestal {
    grid-template-columns: minmax(0, 1fr) minmax(156px, 36%);
    align-items: stretch;
    gap: 12px;
    padding: 8px 10px;
  }
  html[data-mobile-shell="true"] #modals .weekly-objective { gap: 5px; }
  html[data-mobile-shell="true"] #modals .weekly-reward.v4-well {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-content: center;
    align-items: center;
    justify-items: center;
    box-sizing: border-box;
    min-width: 0;
    padding: 6px 10px;
    gap: 2px 4px;
    container-type: inline-size;
  }
  html[data-mobile-shell="true"] #modals .weekly-reward .v4-altar-stage {
    grid-area: 1 / 1 / 3 / 2;
    width: 100%;
    min-height: 0;
    height: 56px;
    padding: 0;
    align-items: center;
  }
  html[data-mobile-shell="true"] #modals .weekly-reward .treasury-chest {
    width: min(100%, 78px) !important;
    height: auto !important;
    aspect-ratio: 130 / 84;
  }
  html[data-mobile-shell="true"] #modals .weekly-reward .v4-altar-ring { width: 100%; height: 16px; }
  html[data-mobile-shell="true"] #modals .weekly-reward > :is(strong,p) {
    grid-column: 2;
    margin: 0;
    line-height: 1.2;
  }
  html[data-mobile-shell="true"] #modals .weekly-reward > .avalon-button {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 4px 0 0;
  }
  @container (width < 140px) {
    html[data-mobile-shell="true"] #modals .weekly-reward > .avalon-button::before,
    html[data-mobile-shell="true"] #modals .weekly-reward > .avalon-button::after { content: none !important; }
  }
}

/* Touch targets for the title and account paths share the existing link skin. */
@media (orientation: landscape) {
  html[data-mobile-shell="true"] .v6-title .avalon-link.v6-title-link {
    min-width:44px; min-height:44px!important; display:inline-flex; align-items:center;
  }
  html[data-mobile-shell="true"] .v6-title-links { column-gap:8px; }
  html[data-mobile-shell="true"] #accounts .account-form .v4-form-well:has(> .avalon-link) > .account-field {
    display:grid; grid-template-rows:minmax(44px,auto) auto; align-items:center;
  }
  html[data-mobile-shell="true"] #accounts .v4-form-well > .avalon-link {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:44px; min-height:44px; line-height:1.2; padding-inline:6px!important;
  }
  html[data-mobile-shell="true"] #accounts .account-form input { min-height:44px!important; height:44px!important; }
  html[data-mobile-shell="true"] #accounts .account-form .avalon-paired {gap:8px!important}
}


/* Internal reading panes share the black-iron / aged-silver game scrollbar. */
html[data-mobile-shell="true"] {
  --scroll-track:#0b1019;
  --scroll-thumb:#8494ae;
  --scroll-thumb-hover:#c6d4e9;
  --scroll-width:7px;
}
html[data-mobile-shell="true"] :is(#modals, #game) :is(.collection-filter-sheet, .collection-grid, .v4-receipts, .mobile-wardrobe-parts, .wardrobe-grid, .wardrobe-detail, .mobile-private-note, .mobile-form-body, .v4-room-sandbox, .rule-body, .result-roles, .settings-body) {
  scrollbar-width:thin !important;
  scrollbar-color:var(--scroll-thumb) var(--scroll-track) !important;
}
@supports selector(::-webkit-scrollbar) {
  html[data-mobile-shell="true"] :is(#modals, #game) :is(.collection-filter-sheet, .collection-grid, .v4-receipts, .mobile-wardrobe-parts, .wardrobe-grid, .wardrobe-detail, .mobile-private-note, .mobile-form-body, .v4-room-sandbox, .rule-body, .result-roles, .settings-body) { scrollbar-width:auto !important; scrollbar-color:auto !important; }
  html[data-mobile-shell="true"] :is(#modals, #game) *::-webkit-scrollbar { width:var(--scroll-width); height:var(--scroll-width); }
  html[data-mobile-shell="true"] :is(#modals, #game) *::-webkit-scrollbar-track { background:var(--scroll-track); }
  html[data-mobile-shell="true"] :is(#modals, #game) *::-webkit-scrollbar-corner { background:var(--scroll-track); }
  html[data-mobile-shell="true"] :is(#modals, #game) *::-webkit-scrollbar-thumb { background:var(--scroll-thumb); border:1px solid var(--scroll-track); border-radius:4px; }
  html[data-mobile-shell="true"] :is(#modals, #game) *::-webkit-scrollbar-thumb:hover { background:var(--scroll-thumb-hover); }
}

/* A shelf, a single product, then the existing fitting tools. All three use the
   same wardrobe draft, ownership, dyes and selection controls as the desktop. */
.wardrobe-card-quality {display:none}
@media (orientation: landscape) {
  /* Same pedestal border and shadow, rasterized once at 3x; fixed slices retain
     their CSS-pixel widths as the stage grows. Its responsive lighting stays live. */
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-preview.v4-stage {
    border-image: url('/wardrobe-stage-frame.87b3c901d9f2.webp') 192 fill / 64px / 40px stretch !important;
    box-shadow: none !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-mode="card"] .wardrobe-equipment-stage,
  html[data-mobile-shell="true"] #modals .cosmetics-document .v4-card-editor-head > .v4-rarity-pills {display:none!important}
  html[data-mobile-shell="true"] #modals .cosmetics-document .v4-card-editor-head > .wardrobe-card-quality {display:block;width:auto;font-size:16px!important}
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-mode="card"] > .wardrobe-preview {display:grid!important;place-items:center}
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-mode="card"] .wardrobe-person-heading {width:100%}
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:not([data-mode="card"]) > .wardrobe-preview {
    display:grid!important;grid-template-rows:28px minmax(0,1fr)!important;align-items:stretch;
    min-height:0!important;height:100%!important;padding:4px!important;box-sizing:border-box;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:not([data-mode="card"]) .wardrobe-person-heading,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:not([data-mode="card"]) .wardrobe-person-heading .cosmetic-nameplate {
    min-height:0!important;height:28px!important;max-height:28px!important;aspect-ratio:auto!important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-equipment-stage,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-equipment-stage .wardrobe-walk-preview {
    min-height:0!important;width:100%!important;height:100%!important;padding:0!important;align-items:center;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-equipment-stage .wardrobe-walk-preview canvas {
    width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;
    min-height:0!important;object-fit:contain!important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document.v4-workbench {
    width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px) !important;
    max-width: 1100px !important;
    padding: 5px 10px !important;
    gap: 5px !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document > .cosmetics-tabs {
    gap: 8px !important; padding: 0 !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document > .cosmetics-content {
    width:100%; overflow:visible !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace[data-mode="wardrobe"] {
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    grid-template-rows:minmax(0,1fr) !important;
    height:100% !important;min-height:0 !important;padding:0 !important;gap:0 !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace[data-mode="wardrobe"][data-wardrobe-view="edit"] {
    grid-template-columns: minmax(150px,29%) minmax(0,1fr) !important;gap:8px !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace[data-mode="wardrobe"]:not([data-wardrobe-view="edit"]) > .wardrobe-preview,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:not([data-wardrobe-view="parts"]) > .mobile-wardrobe-parts,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:not([data-wardrobe-view="shelf"]) .wardrobe-grid,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:is([data-wardrobe-view="shelf"],[data-wardrobe-view="parts"],[data-wardrobe-view="filters"]) .wardrobe-detail,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace:not([data-wardrobe-view="filters"],[data-wardrobe-view="edit"]) .v5-wardrobe-toolbar,
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .v4-wardrobe-top-right,
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .v5-wardrobe-toolbar:not(:has(.v4-layering-pills)),
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .v4-wardrobe-top-left > :not(.v4-layering-pills),
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="filters"] .v4-wardrobe-top-left,
  html[data-mobile-shell="true"] #modals .cosmetics-document:has([data-mode="wardrobe"]:is([data-wardrobe-view="detail"],[data-wardrobe-view="filters"],[data-wardrobe-view="parts"])) .cosmetics-footer,
  html[data-mobile-shell="true"] #modals .cosmetics-document[data-dirty="false"]:not([data-first-create="true"]):not(:has([data-mode="wardrobe"][data-wardrobe-view="edit"])) .cosmetics-footer,
  html[data-mobile-shell="true"] #modals .cosmetics-document[data-dirty="false"]:not([data-first-create="true"]) .cosmetics-footer :is(.avalon-paired,.cosmetics-restore) {
    display:none !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-controls.wardrobe-browse-mode {
    grid-area:1/1 !important;display:block !important; min-height:0 !important;
    height:100% !important;padding:0 !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] > .wardrobe-controls.wardrobe-browse-mode {
    grid-area:1/2 !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode > .v4-wardrobe-browser {
    display:flex !important;flex-direction:column;align-items:stretch;
    width:100%;height:100% !important;min-height:0 !important;padding:0 !important;gap:8px !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-bar,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-pager {
    display:flex;align-items:center;gap:8px;flex:none;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-bar {
    justify-content:space-between;min-height:44px;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-pager {
    margin-left:auto;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-bar h3 {margin:0}
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-bar > button {max-width:30%;overflow:hidden;text-overflow:ellipsis;}
  html[data-mobile-shell="true"] #modals .cosmetics-document :is(.wardrobe-shelf-bar,.wardrobe-design-copy,.wardrobe-detail,.wardrobe-workspace[data-wardrobe-view="filters"],.wardrobe-basics,.cosmetic-card-editor) :is(button,select,input),
  html[data-mobile-shell="true"] #modals .cosmetics-document .v4-layering-pills button {
    min-height:44px !important;min-width:44px !important;white-space:normal;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid.v4-well {
    --shelf-columns:5;flex:1 1 0;display:grid !important;align-items:stretch !important;align-content:center !important;
    grid-template-columns:repeat(var(--shelf-columns),minmax(0,1fr)) !important;
    grid-template-rows:minmax(0,min(100%,235px)) !important;grid-auto-rows:auto !important;
    height:auto !important;min-height:0 !important;max-height:none !important;
    gap:8px !important;padding:8px !important;margin:0 !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid > .wardrobe-item.v4-item.avalon-button {
    display:grid !important;width:100% !important;min-width:0 !important;max-width:none !important;
    height:100% !important;min-height:0 !important;max-height:none !important;
    grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto !important;justify-items:center;align-items:center;
    padding:6px 4px !important;gap:2px !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid .wardrobe-item-picture {
    width:100% !important;height:100% !important;min-height:0 !important;max-height:none !important;
    display:grid !important;place-items:center;
    grid-template:minmax(0,1fr) / minmax(0,1fr);min-width:0;max-width:100%;box-sizing:border-box;
    /* Posters and live dyed canvases share one bounded drawing area. */
    padding:clamp(4px,2%,10px);
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid .wardrobe-item-picture > * {
    grid-area:1/1;min-width:0;min-height:0;max-width:100%;max-height:100%;width:100%;height:100%;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document :is(.wardrobe-item-picture,.wardrobe-design-preview) > :is(.wardrobe-part-art,.cosmetic-character-render),
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid .wardrobe-item-picture canvas,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-design-preview canvas {
    width:100% !important;height:100% !important;min-height:0 !important;max-height:100% !important;
    max-width:100% !important;object-fit:contain !important;image-rendering:pixelated;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid .wardrobe-item-name {
    font-size:15px !important;line-height:18px !important;height:auto !important;min-height:18px !important;
    max-height:none !important;padding:0 !important;white-space:normal !important;text-align:center;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-grid .wardrobe-set-progress {
    font-size:13px;line-height:16px;text-align:center;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-grid:has(.wardrobe-empty) {
    grid-template-columns:minmax(0,1fr) !important;place-items:center;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-mode="wardrobe"][data-wardrobe-view="parts"] .mobile-wardrobe-parts {
    grid-area:1/1;margin:52px 0 0;align-self:stretch;z-index:1;display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:44px;
    align-content:start;align-items:stretch;gap:8px;padding:4px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;
    
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .mobile-wardrobe-parts button.equipment-slot {
    width:100% !important;height:44px !important;min-height:44px !important;max-height:44px !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="filters"] .v4-wardrobe-top-right {
    display:flex !important;gap:8px;flex-wrap:wrap;justify-content:flex-start !important;align-items:center;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="filters"] .v4-wardrobe-top-bar {
    width:100%;justify-content:start;height:auto !important;min-height:44px !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="filters"] .wardrobe-search {
    width:min(50vw,360px) !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="detail"] .wardrobe-detail,
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .wardrobe-detail {
    flex:1 1 0; min-height:0 !important;height:auto !important;max-height:none !important;
    padding:8px 12px !important;overflow:auto !important;overscroll-behavior:contain;touch-action:pan-y;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="detail"] .wardrobe-detail {
    display:grid !important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:16px;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-design-preview {
    width:100% !important;height:100% !important;min-height:0 !important;display:grid !important;place-items:center;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-design-copy {
    display:grid;justify-items:start;align-content:center;gap:8px;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-design-copy > * {margin:0 !important}
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .wardrobe-detail-heading,
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .v5-detail-tools {
    display:flex !important;flex-wrap:wrap !important;gap:8px !important;margin:0!important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document [data-wardrobe-view="edit"] .wardrobe-detail-heading {
    flex-direction:column;align-items:stretch !important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-stack-row {display:flex;flex-wrap:wrap;gap:8px}
  html[data-mobile-shell="true"] #modals .cosmetics-document .v5-detail-tools,
  html[data-mobile-shell="true"] #modals .cosmetics-document :is(.wardrobe-swatches,.v5-skin-grid,.v4-layering-pills,.cosmetic-card-categories,.v4-rarity-pills,.wardrobe-body-choices) {gap:8px !important}
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-detail button.wardrobe-swatch {width:44px!important;height:44px!important}
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-detail .v4-dye-orb {min-width:44px;min-height:44px}
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-bar .avalon-button {
    width:auto!important;min-width:44px!important;max-width:none!important;white-space:nowrap!important;
    padding:0 12px!important;margin:0!important;height:44px!important;
  }
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-shelf-bar .v4-layering-pills {margin-left:auto}
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace[data-mode="wardrobe"]:not([data-wardrobe-view="shelf"]) .wardrobe-grid.v4-well,
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-workspace[data-mode="wardrobe"][data-wardrobe-view="edit"] .v5-wardrobe-toolbar {
    display:none!important;
  }
}
@media (orientation:landscape) and (max-width:759px) {
  html[data-mobile-shell="true"] #modals .cosmetics-document .wardrobe-browse-mode .wardrobe-grid.v4-well {--shelf-columns:4}
}


/* A focused naming step leaves the current body, outfit, card and scroll position mounted. */
html[data-mobile-shell="true"] #modals .cosmetics-document[data-first-create="true"] .v5-basics-info-row:has(.v5-name-field),
html[data-mobile-shell="true"] #modals .cosmetics-document[data-first-create="true"] .v5-basics-title {display:none !important}
html[data-mobile-shell="true"] #modals .cosmetics-document[data-naming="true"] {
  display:flex !important; flex-direction:column; gap:4px; max-height:var(--mobile-viewport-height,100dvh) !important;
}
html[data-mobile-shell="true"] #modals .cosmetics-document[data-naming="true"] > :is(.cosmetics-content,.cosmetics-footer,.cosmetics-tabs) {display:none !important}
html[data-mobile-shell="true"] #modals .cosmetics-document .creation-name-step {
  flex:1; min-height:0; display:flex; flex-direction:column; gap:4px; overflow-y:auto;
  overscroll-behavior:contain; width:min(100%,520px); align-self:center; justify-content:safe center; padding:4px 8px; box-sizing:border-box;
}
html[data-mobile-shell="true"] #modals .creation-name-step .wardrobe-name-field {display:flex;align-items:center;gap:8px;flex:none}
html[data-mobile-shell="true"] #modals .creation-name-step .avalon-input {flex:1;min-width:0;font-size:16px;min-height:44px}
html[data-mobile-shell="true"] #modals .creation-name-step .cosmetics-status:empty {display:none}
html[data-mobile-shell="true"] #modals .creation-name-step .avalon-paired {display:flex;gap:8px;justify-content:end}
html[data-mobile-shell="true"] #modals .creation-name-step .avalon-button {min-width:88px;min-height:44px}

/* Exclusive controls share the existing parchment fields, V4 buttons and item cards. */
.collection-mobile-filters,.collection-filter-sheet {display:none}
html:not([data-mobile-shell="true"]) .collection-document .collection-item .collection-mobile-owned {display:none!important}
.reward-preview-actions {display:flex;justify-content:center;align-items:center;gap:8px}
.reward-preview-actions > button {margin:0}
.rw-result-actions[data-result-layout="receipt"] {display:flex!important;gap:8px;justify-content:center}
.economy-document.rewards-document .rw-result-stage[data-history="true"] .rw-result-actions[data-result-layout="receipt"] > button.avalon-button {width:auto!important;min-width:112px!important;flex:0 0 auto}
.economy-receipt {cursor:pointer}
.rw-result-fallback:has(>button) {display:grid;justify-items:center;align-content:center;gap:8px}
.rw-result-fallback > button {min-height:44px;min-width:96px;margin:0}

@media (orientation:landscape) {
 html[data-mobile-shell="true"] :is(#modals,.reward-preview-host) .game-modal-layer:has(> :is(.collection-document,.reward-preview-document)) {
  box-sizing:border-box;inset:var(--mobile-viewport-top,0px) 0 auto!important;width:100vw!important;max-width:100vw!important;
  margin:0!important;height:var(--mobile-viewport-height,100dvh)!important;max-height:var(--mobile-viewport-height,100dvh)!important;
  padding:max(5px,env(safe-area-inset-top,0px)) max(6px,env(safe-area-inset-right,0px)) max(5px,env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px))!important;
 }
 html[data-mobile-shell="true"] #modals .game-document.collection-document.v4-workbench {
  box-sizing:border-box;position:relative;zoom:1!important;
  width:100%!important;
  max-width:100%!important;
  height:100%!important;min-height:0!important;max-height:100%!important;padding:5px 8px!important;display:grid!important;animation:none!important;
  grid-template-rows:44px minmax(0,1fr) 44px;grid-template-columns:minmax(0,1fr);gap:6px;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .document-title {
  position:absolute!important;width:1px!important;height:1px!important;overflow:hidden;clip-path:inset(50%);padding:0!important;margin:0!important;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .document-close {
  inset:5px 8px auto auto!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .v4-collection-bar {
  grid-row:1;box-sizing:border-box;width:100%;margin:0;padding:0 52px 0 0;display:flex;align-items:center;justify-content:space-between;gap:8px;
 }
 html[data-mobile-shell="true"] #modals .collection-document .collection-tabs {
  box-sizing:border-box;padding:0!important;gap:8px!important;width:auto;flex:0 1 auto;max-width:calc(100% - 112px);height:44px;
 }
 html[data-mobile-shell="true"] #modals .collection-document .collection-tabs > button {
  flex:1 1 auto;min-width:44px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0 6px!important;white-space:nowrap;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .economy-content {
  grid-row:2;min-height:0!important;height:auto!important;max-height:none!important;width:100%;box-sizing:border-box;margin:0;overflow:visible;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .account-message:empty {display:none}
 html[data-mobile-shell="true"] #modals .collection-document > .account-message:not(:empty) {
  grid-row:3;grid-column:1;align-self:center;pointer-events:none;max-width:45%;font-size:13px;margin:0;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .economy-actions {
  grid-row:3;grid-column:1;height:44px;min-height:0!important;margin:0!important;padding:0!important;display:flex;align-items:stretch;justify-content:flex-end;gap:8px!important;
 }
 html[data-mobile-shell="true"] #modals .collection-document > .economy-actions > button {
  width:auto!important;height:44px!important;min-height:44px!important;padding:0 16px!important;font-size:15px!important;
 }
 html[data-mobile-shell="true"] #modals .collection-document .collection-layout,
 html[data-mobile-shell="true"] #modals .collection-document .collection-browser {
  height:100%!important;min-height:0!important;max-height:none!important;width:100%;box-sizing:border-box;margin:0;min-width:0;position:relative;
 }
 html[data-mobile-shell="true"] #modals .collection-document .collection-layout {display:block!important}
 html[data-mobile-shell="true"] #modals .collection-document .collection-browser {display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr);gap:6px}
 html[data-mobile-shell="true"] #modals .collection-document :is(.collection-detail-viewport,.v4-filter-stack) {display:none!important}
 html[data-mobile-shell="true"] #modals .collection-document .collection-mobile-filters {display:flex;align-items:stretch;gap:8px;min-width:0}
 html[data-mobile-shell="true"] #modals .collection-mobile-filters .account-field {display:flex;flex-direction:row;align-items:center;gap:8px;margin:0;font-size:15px}
 html[data-mobile-shell="true"] #modals .collection-mobile-filters .avalon-input {width:clamp(112px,22vw,220px);margin:0}
 html[data-mobile-shell="true"] #modals .collection-document :is(.collection-mobile-filters,.collection-filter-sheet) :is(.avalon-input,.avalon-button) {
  box-sizing:border-box;height:44px!important;min-height:44px!important;min-width:44px!important;margin:0;font-size:16px!important;
 }
 html[data-mobile-shell="true"] #modals .collection-filter-sheet:not([hidden]) {
  position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-content:center;
  align-items:end;gap:8px;padding:8px 12px;margin:0;overflow-y:auto;overscroll-behavior:contain;
 }
 html[data-mobile-shell="true"] #modals .collection-filter-sheet .account-field {display:grid;gap:2px;margin:0;min-width:0;color:var(--v4-parch-hi);font-size:13px}
 html[data-mobile-shell="true"] #modals .collection-filter-sheet .avalon-input {width:100%;min-width:0!important}
 html[data-mobile-shell="true"] #modals .collection-filter-sheet .avalon-paired {grid-column:1/-1;justify-self:end;margin:0;gap:8px}
 html[data-mobile-shell="true"] #modals .collection-document .collection-grid.v4-well {
  min-height:0!important;height:100%!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr))!important;grid-auto-rows:max-content!important;
  align-content:start;gap:8px!important;padding:5px!important;margin:0;box-sizing:border-box;
 }
 html[data-mobile-shell="true"] #modals .collection-grid > .collection-card-row {
  display:grid;grid-column:1/-1;grid-template-columns:repeat(var(--shelf-columns),minmax(0,1fr));gap:8px;
  content-visibility:auto;
  contain-intrinsic-block-size:auto calc(clamp(38px,100dvh - 248px,86px) + 47px);
 }
 html[data-mobile-shell="true"] #modals .collection-grid .collection-item.v4-item.avalon-button {
  box-sizing:border-box;min-height:0!important;height:auto!important;width:100%;min-width:0;display:grid!important;
  grid-template-columns:minmax(0,1fr);grid-template-rows:clamp(38px,calc(100dvh - 248px),86px) minmax(16px,auto) auto!important;gap:2px!important;padding:4px 5px!important;align-content:start;
 }
 html[data-mobile-shell="true"] #modals .collection-grid .collection-item > .collection-art {width:100%;height:100%!important;min-height:0;margin:0;padding:0;contain:layout style}
 html[data-mobile-shell="true"] #modals .collection-grid .collection-item > .collection-art > * {max-height:100%!important;max-width:100%}
 html[data-mobile-shell="true"] #modals .collection-grid .collection-item > .collection-item-name {
  height:auto!important;min-height:0!important;max-height:none!important;line-height:16px!important;font-size:13px!important;white-space:normal;padding:0!important;
 }
 html[data-mobile-shell="true"] #modals .collection-grid .collection-ownership-label {
  position:static!important;display:block!important;justify-self:center;align-self:center;border:0!important;background:transparent!important;box-shadow:none;padding:0!important;
  line-height:15px!important;font-size:12px!important;color:var(--v4-ink)!important;
 }
 html[data-mobile-shell="true"] #modals .collection-grid .collection-empty {grid-column:1/-1;display:grid;justify-items:center;align-content:center;gap:8px;min-height:84px;height:100%;margin:0}
 html[data-mobile-shell="true"] #modals .collection-document .receipt-pagination {height:44px;padding:0!important;gap:8px!important}
 html[data-mobile-shell="true"] #modals .collection-document .receipt-pagination button {height:44px!important;margin:0!important}
 html[data-mobile-shell="true"] #modals .collection-document .v4-receipts {overscroll-behavior:contain;}
 html[data-mobile-shell="true"] #modals .collection-document .treasury-hero.v4-altar {
  grid-template-rows:auto minmax(0,1fr) 44px 44px!important;gap:8px!important;
 }
 html[data-mobile-shell="true"] #modals .collection-document .v4-treasury-buy-btn.avalon-button {
  min-height:44px!important;height:44px!important;margin:0!important;
 }
 html[data-mobile-shell="true"] #modals .collection-document .treasury-hero .v4-treasury-supply-bar {height:44px!important;margin:0!important}
 html[data-mobile-shell="true"] #modals .collection-document .treasury-hero > .collection-hint {
  position:static;grid-column:1/-1;font-size:12px!important;line-height:14px;white-space:normal;margin:0;
 }
 html[data-mobile-shell="true"] #modals .collection-document .economy-receipt {min-height:48px;height:auto!important;gap:8px;padding:2px 8px}
 html[data-mobile-shell="true"] #modals .collection-document .v4-receipt-copy {flex:1;min-width:0;display:flex;flex-flow:row wrap;align-items:center;gap:3px 8px}
 html[data-mobile-shell="true"] #modals .economy-receipt .collection-state {margin:0;white-space:nowrap;font-size:12px}
 html[data-mobile-shell="true"] .reward-preview-host .reward-preview-document {
  zoom:1!important;max-height:calc(var(--mobile-viewport-height,100dvh) - 12px)!important;width:min(720px,calc(100% - 16px));box-sizing:border-box;
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto auto 44px;align-content:center;align-items:center;animation:none!important;
  justify-items:stretch;gap:8px 16px;padding:12px 54px 12px 16px!important;
 }
 html[data-mobile-shell="true"] .reward-preview-document > .document-title {display:none}
 html[data-mobile-shell="true"] .reward-preview-document .reward-preview-stage {grid-column:1;grid-row:1/5;height:min(185px,60dvh);padding:4px;box-sizing:border-box}
 html[data-mobile-shell="true"] .reward-preview-document :is(.reward-preview-name,.v4-detail-meta,.collection-state,.reward-preview-actions) {grid-column:2;text-align:center}
 html[data-mobile-shell="true"] .reward-preview-document :is(.document-close,.reward-preview-actions button) {height:44px!important;min-height:44px!important;min-width:44px!important}
 html[data-mobile-shell="true"] .reward-preview-actions {gap:8px}
 html[data-mobile-shell="true"] #modals .rw-result-stage[data-history="true"] .rw-result-actions[data-result-layout="receipt"] {
  display:flex!important;gap:8px!important;width:max-content!important;max-width:100%;justify-content:center;flex-wrap:nowrap;
 }
 html[data-mobile-shell="true"] #modals .rw-result-stage[data-history="true"] > .rw-standby-actions {width:100%!important;max-width:100%!important;animation:none!important}
 html[data-mobile-shell="true"] #modals .rw-result-stage[data-history="true"] .rw-result-actions[data-result-layout="receipt"] > button.avalon-button {
  flex:0 0 auto;width:112px!important;min-width:112px!important;padding:0 6px!important;height:44px!important;min-height:44px!important;white-space:nowrap;
 }
}
@media (orientation:landscape) and (max-height:330px) {
 html[data-mobile-shell="true"] #modals .collection-document[data-section="receipts"] .receipt-pagination {height:44px}
 html[data-mobile-shell="true"] #modals .collection-document[data-section="receipts"] .economy-content {gap:4px}
 html[data-mobile-shell="true"] #modals .collection-document .weekly-card {padding:4px 8px!important;gap:8px!important;height:100%!important;min-height:0!important}
 html[data-mobile-shell="true"] #modals .collection-document .weekly-reward {height:100%!important;min-height:0!important;padding:2px 8px!important;gap:2px!important}
 html[data-mobile-shell="true"] #modals .weekly-reward .v4-altar-stage {min-height:0!important;height:36px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero.v4-altar {padding:2px 8px!important;gap:2px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero.v4-altar > .v4-altar-stage {min-height:0!important;height:32px!important}
 html[data-mobile-shell="true"] #modals .collection-document .treasury-hero.v4-altar {padding:2px 8px!important;gap:8px!important}
 html[data-mobile-shell="true"] #modals .treasury-hero .v4-treasury-supply-bar,html[data-mobile-shell="true"] #modals .treasury-hero .v4-altar-actions {margin:0!important;padding:0!important}
}

#stage .court-actor-retry, #court .court-actor-retry {
 position:absolute;left:50%;top:28%;transform:translateX(-50%);z-index:8;pointer-events:auto;min-height:44px;
}
.game-modal-layer:has(> .collection-document) { grid-template-columns:minmax(0,1fr); }
html[data-mobile-shell="true"] #modals .game-modal-layer:has(> .collection-document) > .collection-document {
 justify-self:stretch;
}
.collection-document .economy-content[data-loading] {
 display:grid;align-content:center;justify-items:center;min-width:0;
}
html[data-mobile-shell="true"] .collection-document .economy-content[data-loading] {grid-row:2;}

/* The game supplies the same card artwork, seat order, knowledge and actions on both layouts. */
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout {
  --note-card-height: min(47dvh, 196px);
  position:absolute !important; inset:0 !important; width:100% !important; height:100% !important;
  display:grid !important; grid-template-columns:minmax(116px, 26%) minmax(0, 1fr);
  grid-template-rows:minmax(0,1fr) 44px; gap:8px 14px;
  padding: max(58px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)) !important;
  box-sizing:border-box; overflow:visible !important; align-items:stretch;
}
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout > :is(.identity-card,.identity-confirm,.identity-clue-column,.report-preset) {
  position:relative !important; inset:auto !important; transform:none !important; margin:0 !important;
}
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout > .identity-card {
  grid-area:1 / 1; align-self:center; justify-self:center; width:auto !important; height:min(100%,var(--note-card-height)) !important;
  max-height:100%; aspect-ratio:180/276; padding:0 !important; pointer-events:auto;
}
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout > .identity-confirm {
  grid-area:2 / 1; justify-self:center; width:min(100%,170px) !important; min-width:0 !important;
  height:44px !important; min-height:44px !important; font-size:16px !important;
}
html[data-mobile-shell="true"] #game[data-stage="reveal"] .identity-pane:not(:has(.identity-clue-column)):not(:has(.identity-flipping)) {
  grid-template-columns:minmax(0,1fr);
}
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout > .identity-clue-column {
  grid-area:1 / 2 / span 2; width:auto !important; height:auto !important; min-height:0 !important;
  min-width:0; display:flex; flex-direction:column;
}
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout.trickster-identity-layout > .identity-clue-column {grid-row:1}
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-layout > .report-preset {
  grid-area:2 / 2; width:100% !important; height:44px !important; padding:0 !important; min-width:0;
  display:grid !important; grid-template-columns:minmax(148px,1fr) minmax(72px,1fr); align-items:center; gap:8px;
}
html[data-mobile-shell="true"] .identity-layout.trickster-identity-layout .trickster-preset-buttons {
  display:grid !important; grid-template-columns:repeat(2,minmax(68px,1fr)); gap:8px; width:100%; min-width:0;
}
html[data-mobile-shell="true"] .identity-layout.trickster-identity-layout .trickster-preset-buttons > .avalon-button {
  width:100% !important; min-width:68px !important; min-height:44px !important;
}
html[data-mobile-shell="true"] .identity-layout .report-preset .trickster-preset-saved {position:static !important; width:auto !important; margin:0 !important; font-size:13px !important; white-space:normal !important }
html[data-mobile-shell="true"] :is(#game[data-stage="reveal"],#modals .identity-review) .identity-clue-column > .mobile-private-note {
  display:flex !important; flex-direction:column; justify-content:flex-start !important; align-items:stretch;
  overflow-y:auto !important; overflow-x:hidden; overscroll-behavior:contain; min-height:0 !important;
  gap:5px !important; padding:10px 14px !important; text-align:left; pointer-events:auto; touch-action:pan-y;
   
}
html[data-mobile-shell="true"] .mobile-private-note > * {flex:0 0 auto !important; margin:0}
html[data-mobile-shell="true"] .mobile-private-note .identity-clue-title {
  font-size:16px !important; line-height:1.2 !important; text-align:left !important; margin:0 !important; padding:0 0 3px !important;
}
html[data-mobile-shell="true"] .mobile-private-note :is(p,.identity-clue-kind,.identity-clue-empty,.rules-private-record) {
  display:block !important; text-align:left !important; font-size:15px !important; line-height:1.35 !important; overflow-wrap:anywhere;
}
html[data-mobile-shell="true"] .mobile-private-ability {order:1}
html[data-mobile-shell="true"] .mobile-private-note .identity-clue-title:not(:first-child),
html[data-mobile-shell="true"] .mobile-private-ability { margin-top:4px !important }
html[data-mobile-shell="true"] .mobile-private-note .mobile-private-owner strong {font-size:17px}
html[data-mobile-shell="true"] .mobile-private-note [data-faction="good"] {color:var(--arc-good,#154d79)}
html[data-mobile-shell="true"] .mobile-private-note [data-faction="evil"] {color:var(--arc-evil,#872c36)}
html[data-mobile-shell="true"] .mobile-clue-list {display:grid; grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr)); gap:6px 14px; padding:0; list-style:none}
html[data-mobile-shell="true"] .mobile-clue-member {display:flex; align-items:baseline; gap:8px; min-width:0; font-size:15px; line-height:1.4; color:var(--v4-ink); overflow-wrap:anywhere}
html[data-mobile-shell="true"] .mobile-clue-member > strong {flex:none}

html[data-mobile-shell="true"] #modals :is(.v4-room-dialog,.v4-settings-dialog,.v4-wiki-dialog) {
  width:min(830px,100%) !important; max-width:100% !important; max-height:100% !important;
  box-sizing:border-box; min-height:0 !important; gap:8px !important; padding:8px 16px !important;
}
html[data-mobile-shell="true"] #modals :is(.v4-room-dialog,.v4-settings-dialog,.v4-wiki-dialog) > .document-title {
  flex:none; margin:0 !important; padding:0 52px !important; min-height:44px; line-height:44px; font-size:22px !important;
}
html[data-mobile-shell="true"] #modals :is(.v4-room-dialog,.v4-settings-dialog,.v4-wiki-dialog) > .document-close {
  top:8px !important; right:8px !important; min-width:44px !important; min-height:44px !important; width:44px !important; height:44px !important;
}
html[data-mobile-shell="true"] #modals .v4-room-dialog { display:flex !important; flex-direction:column; justify-content:flex-start !important }
html[data-mobile-shell="true"] #modals .v4-room-dialog > :is(.v4-room-sandbox,.mobile-form-body) {
  flex:1 1 auto !important; min-height:0; overflow-y:auto; overscroll-behavior:contain;  
}
html[data-mobile-shell="true"] #modals .v4-room-sandbox { display:grid; align-content:start; grid-template-columns:1fr; gap:8px; padding:2px; box-sizing:border-box }
html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-sandbox-section {gap:6px}
html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-mode-grid {display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:8px}
html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-mode-card {min-height:44px !important; padding:6px 10px !important; gap:3px}
html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-mode-desc {font-size:14px; margin:0; line-height:1.25}
html[data-mobile-shell="true"] #modals .v4-seat-pedestal {padding:6px 10px !important}
html[data-mobile-shell="true"] #modals .v4-seat-pills {display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:8px;width:100%;box-sizing:border-box}
html[data-mobile-shell="true"] #modals .v4-seat-pills > .avalon-button {width:100% !important;min-width:44px !important;min-height:44px !important;margin:0}
html[data-mobile-shell="true"] #modals .v4-room-dialog > .avalon-paired {flex:none; gap:8px !important; margin:0 !important}
html[data-mobile-shell="true"] #modals .v4-room-dialog > .avalon-paired > button {min-height:44px !important}
html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-balance-bar {display:none}

html[data-mobile-shell="true"] #modals .v4-settings-dialog {
  display:grid !important; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:44px minmax(0,1fr) auto;
  align-content:center; justify-content:stretch; height:auto !important;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog > .document-title {
  position:absolute !important; width:1px; height:1px; min-height:0; overflow:hidden; clip-path:inset(50%); padding:0 !important;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog .v4-settings-tabs {grid-area:1 / 1 / 2 / 3; margin:0 52px 0 0 !important; justify-self:start; gap:8px}
html[data-mobile-shell="true"] #modals .v4-settings-dialog .settings-body { grid-area:2 / 1 / 3 / 3; flex:none !important; min-height:0; overflow:auto !important; gap:8px !important; padding:0 !important }
html[data-mobile-shell="true"] #modals .v4-settings-dialog .settings-save-status {grid-row:3; margin:0; align-self:center}
html[data-mobile-shell="true"] #modals .v4-settings-dialog > button:last-child {grid-row:3;grid-column:2; margin:0 !important; width:100px !important; min-height:44px}
html[data-mobile-shell="true"] #modals .v4-settings-dialog > button:not(:last-child):not(.document-close):not([hidden]) { grid-column:1;grid-row:4;justify-self:start }
html[data-mobile-shell="true"] #modals .native-volume-row.v4-setting-row {display:grid !important;grid-template-columns:minmax(0,1fr) 84px !important;align-items:center;gap:8px !important;padding:4px 10px !important;min-height:54px;box-sizing:border-box}
html[data-mobile-shell="true"] #modals .native-volume-row .account-field {display:grid !important;grid-template-columns:auto minmax(60px,1fr) 50px !important;align-items:center;gap:8px;margin:0;min-width:0;font-size:16px}
html[data-mobile-shell="true"] #modals .native-volume-row .account-field input {grid-area:1 / 2 !important;width:100% !important;min-height:44px !important}
html[data-mobile-shell="true"] #modals .native-volume-row .account-field output {grid-area:1 / 3 !important}
html[data-mobile-shell="true"] #modals .native-volume-row button,
html[data-mobile-shell="true"] #modals .v4-settings-tabs button { min-height:44px !important; min-width:44px !important }

html[data-mobile-shell="true"] #modals .v4-wiki-dialog {
  display: grid !important;
  grid-template-columns: clamp(136px, 22vw, 168px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: 100% !important; max-width: 100% !important;
  height: calc(var(--mobile-viewport-height, 100dvh) - 20px) !important;
  max-height: calc(var(--mobile-viewport-height, 100dvh) - 20px) !important;
  min-height: 0 !important;
  padding: 8px 10px !important;
  gap: 6px 10px !important;
  overflow: hidden !important;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog > .document-title {
  grid-area: 1 / 1 / 2 / 2;
  padding: 2px 4px !important;
  min-height: 30px !important; line-height: 1.2 !important;
  font-size: 16px !important; text-align: center; white-space: nowrap;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog > .rule-tabs {
  grid-area: 2 / 1 / 3 / 2;
  display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important;
  gap: 6px !important; margin: 0 !important; padding: 4px !important;
  overflow-y: auto; overflow-x: hidden; min-height: 0;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog > .rule-tabs .avalon-button[role="tab"] {
  width: 100% !important; min-width: 0 !important;
  height: 40px !important; min-height: 38px !important;
  padding: 0 6px !important; font-size: 13px !important; white-space: nowrap;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog > .rule-body {
  grid-area: 1 / 2 / 3 / 3;
  flex: 1 1 auto !important; min-height: 0 !important; min-width: 0 !important;
  height: 100% !important;
  overflow-y: auto !important; overflow-x: hidden !important;
  padding: 4px 42px 8px 4px !important;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  touch-action: pan-y !important;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-role-cards-grid,
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-steps,
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-win-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-dim-item {
  grid-template-columns: 92px minmax(0, 1fr); gap: 6px; padding: 5px 8px;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-role-card-head {
  grid-template-columns: 72px minmax(0, 1fr); gap: 10px;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-role-art-mini .court-card {
  width: 72px !important;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .v4-wiki-role-art-mini > .avalon-button {
  min-height: 30px !important; height: 30px !important; font-size: 11px !important;
}
html[data-mobile-shell="true"] #modals .v4-wiki-dialog .avalon-button.v4-wiki-role-chip {
  min-height: 30px !important; min-width: 0 !important; padding: 2px 7px !important; margin: 2px !important; font-size: 12.5px !important;
}
html[data-mobile-shell="true"] #modals .record-archive-tab {height:44px !important;min-height:44px !important}

@media (max-height:320px) {
  html[data-mobile-shell="true"] #modals dialog:has(> .v4-room-dialog) {padding:4px !important}
  html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-sandbox-section:first-child > .v4-sandbox-heading,
  html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-mode-desc {display:none}
  html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-seat-pedestal {display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 8px;align-items:center}
  html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-seat-header {flex-direction:column;align-items:flex-start;gap:2px}
  html[data-mobile-shell="true"] #modals .v4-room-sandbox .v4-seat-hint {grid-column:1/-1}
}

/* Each page has one scroll owner. The verdict and the room action stay in reach. */
html[data-mobile-shell="true"] #game[data-stage="game_result"] .game-actions > .result-pane.v4-result-gallery {
  --result-card-width:clamp(64px,min(10.5vw,calc((100dvh - 174px) * 0.652)),110px) !important;
  display:grid !important; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) 44px;
  inset:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)) !important;
  overflow:visible !important; align-items:stretch !important; justify-content:stretch !important; gap:8px !important;
}
html[data-mobile-shell="true"] #game[data-stage="game_result"] .result-pane.v4-result-gallery > .v4-result-verdict-hero {grid-column:1; grid-row:1; gap:3px}
html[data-mobile-shell="true"] #game[data-stage="game_result"] .result-pane.v4-result-gallery[data-page="outcome"]:not(:has(.v4-assassination-showdown)) > .v4-result-verdict-hero {grid-row:1/3;align-self:center}
html[data-mobile-shell="true"] #game[data-stage="game_result"] .result-pane.v4-result-gallery > .v4-assassination-showdown {grid-row:2; grid-column:1; width:min(460px,100%) !important; min-width:0; height:fit-content; max-height:100%; align-self:center; justify-self:center; box-sizing:border-box; overflow:auto}
html[data-mobile-shell="true"] #game[data-stage="game_result"] .result-pane.v4-result-gallery[data-page="outcome"] > .result-roles,
html[data-mobile-shell="true"] #game[data-stage="game_result"] .result-pane.v4-result-gallery[data-page="seats"] > .v4-assassination-showdown {display:none !important}
html[data-mobile-shell="true"] #game[data-stage="game_result"] .result-pane.v4-result-gallery[data-page="seats"] > .result-roles {grid-row:2; grid-column:1; min-height:0; min-width:0; height:100% !important; max-height:100% !important; width:100%; align-items:stretch !important; justify-content:flex-start !important; overflow:auto !important;   overscroll-behavior:contain;box-sizing:border-box}
html[data-mobile-shell="true"] #game .result-pane.v4-result-gallery .result-card-row {min-width:0; margin:0; justify-content:center; gap:8px}
html[data-mobile-shell="true"] #game .result-pane.v4-result-gallery .result-card-row .v4-result-seat {flex:0 1 var(--result-card-width); min-width:44px}
html[data-mobile-shell="true"] #game .result-pane.v4-result-gallery > .result-footer {grid-column:1/-1; grid-row:3; align-items:stretch; justify-content:center; gap:8px; min-height:44px}
html[data-mobile-shell="true"] #game .result-pane.v4-result-gallery .result-footer > button {width:auto !important; min-width:112px; height:44px !important; padding:0 12px !important; margin:0 !important}

/* Host configuration, account maintenance and records use the same touch shell. */
html[data-mobile-shell="true"] #accounts .v4-form-well:has(input[name="repeat-password"]) > label:last-child {
  grid-column: 1 / -1;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench {
  grid-template-columns:minmax(140px,1fr) minmax(220px,2fr) 44px;
  grid-template-rows:44px minmax(0,1fr) auto 44px;
  gap:5px 8px;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .role-deck-summary {
  grid-area:1 / 2; width:100%; align-self:center; justify-self:center;
  max-width:350px; box-sizing:border-box;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .role-deck-scroll {
  grid-area:2 / 1 / 3 / -1; margin:0 !important; overscroll-behavior:contain;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .role-deck-feedback {
  grid-area:3 / 1 / 4 / -1; margin:0; text-align:start; line-height:1.2;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .v4-identity-footer {
  grid-area:4 / 1 / 5 / -1; display:flex; align-items:stretch; gap:8px; padding:0; margin:0;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .v4-identity-footer > .avalon-paired {
  display:flex !important; flex:0 0 auto; flex-flow:row nowrap; align-items:stretch; gap:8px; margin:0 0 0 auto;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench .v4-identity-footer .avalon-button {
  width:auto !important; min-width:100px !important; padding:0 12px !important; margin:0;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .avalon-button:not(.document-close) {
  grid-area:4 / 1 / 5 / -1; justify-self:end;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .settings-body {
  display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px !important;
  align-content:start; overscroll-behavior:contain;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .settings-body > .v4-setting-row {
  display:grid; grid-template-columns:auto minmax(80px,1fr); align-items:center;
  gap:8px; padding:4px 8px !important; min-width:0; margin:0; min-height:52px;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .settings-body > fieldset.v4-setting-row {
  display:flex; align-items:center; justify-content:space-between; position:relative; padding-left:82px !important;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics fieldset.v4-setting-row legend {
  position:absolute; top:50%; left:8px; transform:translateY(-50%); padding:0;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .graphics-options {width:100%; margin:0}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .v4-setting-row :is(select,button) {
  width:100% !important; min-width:44px !important; min-height:44px !important; margin:0;
}
html[data-mobile-shell="true"] #modals .v4-settings-dialog.native-graphics .settings-body > .account-mail-note {
  grid-column:1/-1; margin:0; line-height:1.2;
}
html[data-mobile-shell="true"] #modals .game-document.v4-records-dialog {
  display:flex !important; flex-direction:column; justify-content:flex-start; align-items:stretch;
  width:min(860px,100%) !important; height:100% !important; max-height:100% !important;
  min-height:0 !important; box-sizing:border-box; gap:8px; padding:8px 14px !important;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog > .document-title {
  flex:0 0 44px; min-height:44px; margin:0; padding:0 50px; line-height:44px;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-stats-row {
  flex:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-stat-card {
  display:flex; flex-flow:row wrap; justify-content:center; align-items:center; gap:2px 8px;
  min-height:0; padding:5px 8px; box-sizing:border-box;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-stat-card :is(.v4-stat-sub,.v4-gauge) {display:none}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-stat-card .v4-stat-value {font-size:18px; line-height:1.15}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-records-list {
  flex:1 1 0; min-height:0; max-height:none; margin:0; padding:4px; overflow-y:auto; overscroll-behavior:contain;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-record-row {
  min-height:60px; flex-shrink:0; gap:8px; padding:5px 8px;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-record-thumb {width:32px; height:48px}
html[data-mobile-shell="true"] #modals .v4-records-dialog > .avalon-button:last-child {
  flex:none; min-height:44px; margin:0; align-self:end;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog > .account-mail-note {margin:0; font-size:12px; line-height:1.2}
html[data-mobile-shell="true"] #modals .record-overview-roster {gap:8px}
html[data-mobile-shell="true"] #modals .record-archive-dialog .record-overview-seat,
html[data-mobile-shell="true"] #modals .record-archive-dialog .record-overview-detail-close {
  min-height:44px !important; min-width:44px !important;
}

/* Keep the public track centered like PC (shields on top, gems below), compact & stage-scale adaptive. */
html[data-mobile-shell="true"] #game .mobile-match-progress {
  display:flex; flex-direction:column; align-items:center; justify-content:center; width:max-content; max-width:100%;
  gap:max(3px, calc(3.5px * var(--stage-scale, 1))); min-height:0; margin:0 auto; box-sizing:border-box; pointer-events:auto;
  touch-action:manipulation; cursor:pointer; -webkit-tap-highlight-color:transparent;
}
html[data-mobile-shell="true"] #game .mobile-match-progress .v4-shield-track {gap:max(10px, calc(13px * var(--stage-scale, 1))); margin:0}
html[data-mobile-shell="true"] #game .mobile-match-progress .mission-shield {--shield-size:max(18px, calc(20px * var(--stage-scale, 1)))}
html[data-mobile-shell="true"] #game .mobile-match-progress .mission-shield:not(:last-child)::after {width:max(10px, calc(13px * var(--stage-scale, 1)))}
html[data-mobile-shell="true"] #game .mobile-match-progress .v4-gem-track {
  --gem-size:max(11px, calc(12.5px * var(--stage-scale, 1))); --gem-gap:max(6px, calc(7px * var(--stage-scale, 1)));
  padding:0; margin:0; pointer-events:auto;
}
html[data-mobile-shell="true"] #game .match-hud-help[data-help="progress"] {
  grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 12px; width:min(540px,calc(100vw - 32px));
}
html[data-mobile-shell="true"] #game .match-hud-help[data-help="progress"] > :nth-child(4),
html[data-mobile-shell="true"] #game .match-hud-help[data-help="progress"] > :last-child {grid-column:1/-1}
html[data-mobile-shell="true"] #game .v5-command-bar:not([data-theme="nominate"]) .v5-command-hint {
  white-space:normal; overflow:visible; overflow-wrap:anywhere; text-overflow:clip; font-size:13px;
}
html[data-mobile-shell="true"] #game .v5-command-roster .v5-roster-grid {
  grid-auto-rows:minmax(52px,auto); max-height:calc(100dvh - 156px); overflow-y:auto;
  overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#9a9b93 #262520;
}
html[data-mobile-shell="true"] #game .v5-command-roster .avalon-button.v5-roster-tile {
  height:auto !important; align-self:stretch; grid-template-columns:24px minmax(0,1fr); min-height:52px !important;
}
html[data-mobile-shell="true"] #game .v5-command-roster .v5-roster-meta {
  min-width:0; flex-wrap:wrap; align-content:center; justify-content:flex-start;
}
html[data-mobile-shell="true"] #game .v5-command-roster .v5-roster-name {
  width:100%; text-align:left; white-space:normal; overflow:visible; overflow-wrap:anywhere; text-overflow:clip;
  font-size:13px; line-height:1.15;
}
html[data-mobile-shell="true"] #game:has(.v5-command-bar[data-roster-open="true"]) :is(.game-hud,.game-toolbar) {
  visibility:hidden;
}
html[data-mobile-shell="true"] #game .v5-command-bar .mobile-sword-holder {
  width:100%; max-width:744px; margin:0 auto 4px; white-space:normal; overflow-wrap:anywhere;
  font-size:14px; line-height:1.25; text-align:center;
}

/* Short-screen shelves retain a complete first row and fixed navigation. */
html[data-mobile-shell="true"] #modals dialog.game-modal-layer:has(> .v4-records-dialog) {
  box-sizing:border-box; width:100% !important; max-width:100% !important; height:100% !important;
  padding:max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)) !important;
}
html[data-mobile-shell="true"] #modals .game-document.v4-records-dialog {
  width:min(900px,calc(100vw - 22px)) !important; max-width:100% !important; zoom:1 !important;
  height:100% !important; padding:6px 12px !important; gap:5px !important;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog > .document-title {
  margin:0 !important; padding:0 52px !important; flex:0 0 44px; min-height:0 !important; max-height:44px;
}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-stat-card :is(.v4-progress,.v4-stat-sub) {display:none}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-stat-card {padding:3px 6px !important; gap:2px 6px !important; min-height:28px}
html[data-mobile-shell="true"] #modals .v4-records-dialog .v4-record-row {
  min-height:60px !important; padding:4px 8px !important; gap:8px !important;
}
html[data-mobile-shell="true"] #modals .collection-document .v4-ledger-pills {gap:8px}
html[data-mobile-shell="true"] #modals .collection-document .v4-ledger-pills button {min-height:44px !important; min-width:44px !important}
html[data-mobile-shell="true"] #accounts .account-panel:has(> .v4-account-card) {
  display:flex; flex-direction:column; width:min(740px,100%); height:100%; min-height:0; overflow:visible;
  padding:6px 12px !important; box-sizing:border-box; gap:6px !important;
}
html[data-mobile-shell="true"] #accounts .account-panel:has(> .v4-account-card) > .document-title {
  margin:0 !important; padding:0 !important; min-height:36px; line-height:36px;
}
html[data-mobile-shell="true"] #accounts .account-panel > .v4-account-card {
  flex:1 1 auto; min-height:0; margin:0; padding:8px 12px; overflow:auto; overscroll-behavior:contain;
}
html[data-mobile-shell="true"] #accounts .account-panel:has(> .v4-account-card) > .avalon-paired {
  flex:none; margin:0 !important; gap:8px !important;
}
html[data-mobile-shell="true"] #accounts .account-panel > .account-message:empty {display:none}
.mobile-deck-pages,.mobile-deck-role-name {display:none}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench {
  grid-template-columns:minmax(90px,.8fr) auto minmax(140px,1.3fr) 44px;
}
html[data-mobile-shell="true"] #modals .game-document.v4-identity-workbench > .role-deck-summary {grid-area:1/3}
html[data-mobile-shell="true"] #modals .v4-identity-workbench > .mobile-deck-pages {
  display:flex; grid-area:1/2; align-self:center; gap:8px; padding:0; margin:0;
}
html[data-mobile-shell="true"] #modals .mobile-deck-pages button {min-width:64px; min-height:44px !important; padding:0 8px !important}
html[data-mobile-shell="true"] #modals .role-deck-scroll[data-page="roles"] > .identity-local-rules,
html[data-mobile-shell="true"] #modals .role-deck-scroll[data-page="relics"] > .v4-deck-columns {display:none}
html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot {
  display:grid; grid-template-columns:44px minmax(0,1fr); grid-template-rows:auto auto;
  align-items:center; gap:3px 8px !important;
}
html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot > .court-card {
  grid-column:1; grid-row:1/3; width:44px !important; align-self:center; justify-self:center;
}
html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot .mobile-deck-role-name {
  display:block; grid-column:2; font-size:14px; white-space:normal; line-height:1.25;
}
html[data-mobile-shell="true"] #modals .v4-identity-workbench .v4-role-slot > button {grid-column:2; grid-row:2; min-width:44px !important}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog .v4-prompt-card {padding:5px 8px !important; gap:4px !important}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog .v4-adjust-lead {margin:0 !important}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog .v4-plan-option {padding:7px 10px !important; flex:0 0 auto !important; height:auto !important}
@media(max-height:320px) {
  html[data-mobile-shell="true"] #modals .v4-records-dialog > .account-mail-note {display:none}
}

/* Keep header & footer fixed while middle parchment box scrolls cleanly without ever squishing rows. */
html[data-mobile-shell="true"] #modals .game-document.v4-adjust-dialog {
  display:flex !important; flex-direction:column !important;
  box-sizing:border-box; width:min(840px,calc(100vw - 24px)) !important;
  height:calc(var(--mobile-viewport-height, 100dvh) - 16px) !important;
  max-height:calc(var(--mobile-viewport-height, 100dvh) - 16px) !important;
  min-height:0 !important; overflow:hidden !important;
  padding:6px 10px 8px !important; gap:5px !important;
}
html[data-mobile-shell="true"] #modals .game-document.v4-adjust-dialog > .document-title {
  flex:0 0 auto !important; margin:0 !important; padding:0 40px 4px !important;
  min-height:28px !important; line-height:28px !important; font-size:18px !important;
}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-box {
  flex:1 1 auto !important; margin:0 !important; min-height:0 !important; height:auto !important;
  box-sizing:border-box; overflow-y:auto !important; overflow-x:hidden !important;
  touch-action:pan-y !important; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  padding:8px 10px !important; gap:8px !important;
}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-box > *,
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-box .v4-plan-option,
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-box .v4-plan-rows,
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-box .v4-lancelot-bar,
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-box .v4-lancelot-mode-explain {
  flex-shrink:0 !important; height:auto !important;
}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .role-deck-feedback {
  flex:0 0 auto !important; margin:0 !important; padding:0 !important; font-size:11px !important; line-height:1.25 !important;
}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-footer,
html[data-mobile-shell="true"] #modals .v4-adjust-dialog .avalon-paired {
  flex:0 0 auto !important; margin:0 !important; padding:0 !important;
}
html[data-mobile-shell="true"] #modals .v4-adjust-dialog > .v4-adjust-footer .avalon-button {
  min-height:36px !important; height:36px !important; font-size:14px !important;
}
@media(max-height:320px) {
  html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-copy {
    display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; align-items:start;
  }
  html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-copy > * {grid-column:1 / -1}
  html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-copy > :first-child {grid-area:1 / 1}
  html[data-mobile-shell="true"] #modals .v4-candidates-dialog .v4-candidate-copy > button {
    grid-area:1 / 2; width:auto !important; min-width:68px !important;
  }
}

/* The traveller card keeps its portrait and actions on screen; only the dossier scrolls. */
html[data-mobile-shell="true"] #modals .game-document.native-role-deck:has(> .v4-prompt-card) > .avalon-paired button {
  min-height:48px !important;
}
html[data-mobile-shell="true"] #modals .game-document.cosmetics-public-card.v4-card-shell {
  box-sizing:border-box; zoom:1 !important; display:grid !important;
  grid-template-rows:44px minmax(0,1fr) 44px;
  width:min(940px,calc(100vw - 28px)) !important; max-width:100% !important;
  height:100% !important; min-height:0 !important; max-height:100% !important;
  padding:6px 12px !important; gap:6px !important;
}
html[data-mobile-shell="true"] #modals .game-document.v4-card-shell > .document-close {
  right:8px !important; top:6px !important; width:44px !important; height:44px !important;
  min-width:44px !important; min-height:44px !important;
}
html[data-mobile-shell="true"] #modals .v4-card-shell > .v4-card-body {
  grid-row:2; min-height:0; grid-template-columns:minmax(120px,26%) minmax(0,1fr); gap:8px;
}
html[data-mobile-shell="true"] #modals .v4-card-body .v4-card-stage {min-height:0; padding:4px}
html[data-mobile-shell="true"] #modals .v4-card-stage .v4-card-figure-box {min-height:0}
html[data-mobile-shell="true"] #modals .v4-card-figure-box .cosmetic-character-render canvas {
  width:clamp(92px,calc(100dvh - 190px),158px) !important; height:auto !important;
}
html[data-mobile-shell="true"] #modals .v4-card-dossier {min-height:0; overflow:auto; overscroll-behavior:contain; gap:8px}
html[data-mobile-shell="true"] #modals .v4-card-dossier > section {flex:0 0 auto}
html[data-mobile-shell="true"] #modals .v4-card-shell > .v4-card-footer {
  grid-row:3; min-height:0; margin:0; padding:0; gap:8px; align-items:stretch;
}
html[data-mobile-shell="true"] #modals .v4-card-footer button {height:44px !important; min-height:44px !important}

html[data-mobile-shell="true"] #modals :is(.v4-identity-workbench > .mobile-deck-pages,.record-archive-dialog > .record-archive-tabs) {gap:8px !important}

/* Keep the desktop emergence in its original positioning context. */
.rw-flight-field { display:contents }
.rw-flight-caption { display:none }

@media (orientation:landscape) {
 /* The author's radial stops (62/58/60% of farthest-corner) expressed as
    diameters of one linear alpha mask. The parent retains the exact responsive
    Gaussian blur, screen blend, animation, clip and tier colors. */
 html[data-mobile-shell="true"] .v9-result-aurora[data-mask="ready"] > i {background:none}
 html[data-mobile-shell="true"] .v9-result-aurora[data-mask="ready"] > i::before {
  content:"";position:absolute;inset:0;
  background:var(--orb-color,var(--v9-a));mask:var(--v9-orb-mask) center/var(--orb-size,87.68124%) no-repeat;
 }
 html[data-mobile-shell="true"] .v9-result-aurora[data-mask="ready"] > i:nth-child(2) {--orb-size:82.02439%;--orb-color:var(--v9-b)}
 html[data-mobile-shell="true"] .v9-result-aurora[data-mask="ready"] > i:nth-child(3) {--orb-size:84.85281%;--orb-color:var(--v9-c)}
 html[data-mobile-shell="true"] #modals .game-modal-layer:has(> .rewards-document) {
  inset:var(--mobile-viewport-top,0px) 0 auto;
  height:var(--mobile-viewport-height,100dvh);max-height:none;
 }
 html[data-mobile-shell="true"] #modals .game-modal-layer > .rewards-document {
  width:100%!important;height:100%!important;box-sizing:border-box;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] {
  --rw-pad-top:max(8px,env(safe-area-inset-top));
  --rw-pad-left:max(12px,env(safe-area-inset-left));
  --rw-pad-bottom:max(8px,env(safe-area-inset-bottom));
  display:grid;grid-template:44px minmax(0,1fr) auto / minmax(0,1fr);
  place-items:stretch;place-content:stretch;gap:4px;box-sizing:border-box;
  padding:var(--rw-pad-top) max(12px,env(safe-area-inset-right)) var(--rw-pad-bottom) var(--rw-pad-left);
 }
 html[data-mobile-shell="true"] #modals .rw-safe-inset-width {
  position:absolute;width:var(--rw-pad-left);height:0;visibility:hidden;pointer-events:none;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] > :is(.rw-reveal-quality,.rw-standby-actions) {
  left:var(--rw-axis-x,50%);
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] > .rw-reveal-quality {
  top:max(10px,env(safe-area-inset-top));
  font-size:clamp(20px,6.2dvh,28px);
  letter-spacing:4px;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] > .rw-standby-actions {
  bottom:max(8px,env(safe-area-inset-bottom));
  gap:6px;
  max-width:calc(100vw - 24px);
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] .rw-standby-badge {
  padding:3px 12px;
  font-size:12px!important;
  line-height:1.25!important;
  letter-spacing:1px;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] .rw-standby-btn-row {
  gap:10px;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] .rw-standby-confirm.avalon-button {
  width:176px!important;min-width:148px!important;min-height:40px!important;
  padding:6px 16px!important;font-size:16px!important;letter-spacing:2px!important;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] .rw-standby-cancel.avalon-button {
  width:108px!important;min-height:40px!important;
  padding:6px 12px!important;font-size:14px!important;letter-spacing:1px!important;
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-v9] .rw-standby-error {
  padding:2px 10px;font-size:12px!important;line-height:1.25!important;
 }
 /* Balance the trailing glyph spacing without changing the tier's typography. */
 html[data-mobile-shell="true"] #modals .rw-reveal-quality :is(.rw-quality-text,.rw-quality-echo) {
  padding-inline-start:calc(8 * var(--v4-u));
 }
 html[data-mobile-shell="true"] #modals .rw-reveal-quality .rw-quality-star {letter-spacing:0}
 html[data-mobile-shell="true"] #modals .rw-flight-field {
  display:block;grid-area:2/1;place-self:stretch;position:relative;container-type:size;min-width:0;min-height:0;
  pointer-events:none;z-index:6;
 }
 html[data-mobile-shell="true"] #modals .rw-flight-caption {
  grid-area:3/1;display:grid;text-align:center;gap:2px;z-index:6;pointer-events:none;
  color:var(--v4-gold-hi,#ffe7a3);font:14px/1.2 AvalonPixel,monospace;
  text-shadow:0 1px 3px #100d18,0 0 5px #100d18;
  background:radial-gradient(ellipse at center,rgba(16,13,24,.72),transparent 64%);
 }
 html[data-mobile-shell="true"] #modals .rw-reveal[data-reward-flight] > .rw-reveal-quality {visibility:hidden}
 html[data-mobile-shell="true"] #modals .rw-flight-caption strong {color:#fff6e2;font-size:18px}
 html[data-mobile-shell="true"] #modals .rw-emerging-reward {
  top:50%;left:50%;width:100%;height:100%;max-width:none;
  transform:translate(-50%,-50%) translateY(calc((1 - var(--reward-rise,0)) * 22cqh)) scale(var(--reward-scale,.16));
 }
 html[data-mobile-shell="true"] #modals .rw-emerging-reward .rw-result-display,
 html[data-mobile-shell="true"] #modals .v9-result-card .rw-result-display {
  display:flex;align-items:center;justify-content:center;
  margin:0;padding:0;width:100%;height:100%;max-height:none;min-height:0;min-width:0;
  container-type:size;
 }
 html[data-mobile-shell="true"] #modals .rw-result-display {--art-ratio:1;--art-height:78cqh;--art-width:300px}
 html[data-mobile-shell="true"] #modals .rw-result-display[data-reward-kind="nameplate"] {
  --art-ratio:3.3;--art-width:520px;--art-height:76cqh
 }
 html[data-mobile-shell="true"] #modals .rw-result-display[data-reward-kind="avatar"] {--art-width:180px}
 html[data-mobile-shell="true"] #modals .rw-result-display:is([data-reward-kind="set"],[data-reward-kind="garment"]) {--art-height:87cqh}
 html[data-mobile-shell="true"] #modals .rw-result-display:not([data-reward-kind="coins"]) > :not(.rw-result-fallback) {
  flex:none;box-sizing:border-box;
  width:min(90cqw,var(--art-width),calc(var(--art-height) * var(--art-ratio)))!important;
  max-width:100%;height:auto!important;max-height:var(--art-height);aspect-ratio:var(--art-ratio);
  object-fit:contain;align-self:center;justify-self:center;
 }
 html[data-mobile-shell="true"] #modals .rw-result-display .collection-part-media {display:grid;place-items:center}
 html[data-mobile-shell="true"] #modals .rw-result-display .collection-part-media .wardrobe-part-art,
 html[data-mobile-shell="true"] #modals .rw-result-display :is(.wardrobe-part-art,.cosmetic-character-render) canvas {
  width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;image-rendering:pixelated;
 }
 html[data-mobile-shell="true"] #modals .rw-result-stage.v9-result {
  grid-template: minmax(0,1fr) auto / minmax(0,1fr); align-items:stretch;
  gap:6px;padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
 }
 html[data-mobile-shell="true"] #modals .rw-result-stage .v9-result-card {
  grid-area:1/1;justify-self:center;width:min(100%,560px);height:100%;min-height:0;
  display:grid;grid-template:max-content minmax(0,1fr) max-content / minmax(0,1fr);grid-auto-rows:max-content;
  justify-items:center;align-items:center;gap:4px;box-sizing:border-box;padding:3px 8px;
 }
 html[data-mobile-shell="true"] #modals .v9-result-card > :is(.rw-result-display,.rw-result-quality,.rw-result-title,.rw-result-description,.rw-result-actions) {grid-area:auto}
 html[data-mobile-shell="true"] #modals .rw-result-stage > .rw-standby-actions {
  grid-area:2/1;position:static;translate:none;transform:none;justify-self:center;
  animation-name:rw-mobile-dock-arrival;
  width:min(100%,530px);max-width:100%;margin:0;gap:4px;
 }
 html[data-mobile-shell="true"] #modals .rw-result-stage .v9-result-array {
  grid-area:1/1;place-self:end center;position:relative;inset:auto;width:min(48vw,49dvh);translate:0 -21%;
 }
}
@keyframes rw-mobile-dock-arrival {from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
