/* V88 — one shared, translucent menu surface and bounded mobile controls. */
.craft-item-inspection { display:grid;gap:8px;padding:12px;border:1px solid #a5bdae66;background:rgba(2,10,10,.32);min-width:0; }
.craft-workshop .craft-inspection-heading { display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:10px; }
.craft-inspection-heading h3 { margin:0;text-align:left;font-size:clamp(17px,2vw,24px);overflow-wrap:anywhere; }
.craft-inspection-icon { width:64px;height:64px;display:grid;place-items:center; }.craft-inspection-icon .item-icon { width:60px;height:60px;max-width:100%;max-height:100%; }
.craft-item-inspection p { margin:0;white-space:pre-line;font-size:13px;line-height:1.4; }
.craft-inspection-level { font-size:16px;color:#f4df9b; }.craft-inspection-rarity,.craft-inspection-profession { color:#ccd9d0; }
.craft-inspection-output-note { color:#e8d187; }.craft-inspection-description { color:#e7e9df; }
.craft-inspection-stats { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px;margin:0;min-width:0; }
.craft-inspection-stats > div { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;min-width:0; }
.craft-inspection-stats dt { font-size:13px;overflow-wrap:anywhere; }.craft-inspection-stats dd { margin:0;font-weight:800;color:#f4df9b; }
.craft-inspection-range { grid-column:1/-1;font-size:11px;color:#c6d0c9; }.craft-inspection-fixed { color:#c6d0c9;font-size:11px!important; }
.craft-workshop .craft-detail-list .craft-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(680px,100%);justify-self:center; }
.craft-workshop .craft-detail-list .craft-actions button { min-width:0;white-space:normal;overflow-wrap:anywhere; }
.craft-workshop .craft-detail-list .craft-costs > div,.craft-workshop .craft-detail-list .craft-gold { min-width:0;max-width:100%;box-sizing:border-box; }
.craft-workshop .craft-detail-list .craft-costs span,.craft-workshop .craft-detail-list .craft-gold strong { min-width:0;overflow-wrap:anywhere; }
.craft-workshop .craft-detail-list select { background:rgba(2,10,10,.35)!important; }
@media(max-width:420px) { .craft-item-inspection { padding:8px; }.craft-inspection-stats { grid-template-columns:minmax(0,1fr); }.craft-inspection-level { font-size:14px; } }
#gameMenu.standard-menu-open { background:rgba(2,9,8,.57)!important; }
#gameMenu.standard-menu-open > .game-menu-window > #outfitPage:not([hidden]),
#gameMenu.standard-menu-open > .game-menu-window > #configPage:not([hidden]) {
  background:transparent!important;border:0!important;border-image:none!important;
  overflow:hidden!important;scrollbar-gutter:auto!important;min-height:0!important;
}
#gameMenu.standard-menu-open > .game-menu-window > #configPage:not([hidden]),
#gameMenu.standard-menu-open > .game-menu-window > #configPage:not([hidden]):has(.skills-v81:not([hidden])) {
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:44px minmax(0,1fr)!important;gap:8px!important;
}
#configPage .config-subtabs { width:min(640px,100%)!important;margin:0 auto!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;min-width:0; }
#configPage .config-subtabs button { width:100%;min-width:0!important;min-height:44px!important;font-size:14px!important; }
#configPage .config-modern-view:not([hidden]) { width:min(920px,100%)!important;padding:0!important;min-height:0!important;overflow:hidden!important;gap:clamp(8px,2.5vh,28px)!important;align-content:center!important; }
#configPage .config-modern-view.skills-v81:not([hidden]) { align-content:stretch!important;grid-template-rows:auto minmax(0,1fr) auto!important;gap:6px!important; }
#configPage .five-step-setting { min-width:0;grid-template-columns:minmax(0,1fr) 44px minmax(95px,1.4fr) 44px!important;gap:clamp(5px,1.5vw,16px)!important; }
#configPage .five-step-setting > strong { font-size:clamp(12px,1.8vw,24px)!important;overflow-wrap:anywhere; }
#configPage .five-step-setting > button { width:44px!important;height:44px!important;min-height:44px!important;font-size:25px!important;border-width:2px!important; }
#configPage .step-squares { gap:clamp(3px,.8vw,10px)!important; }
#configPage .step-square { border-width:2px!important; }
#configPage .mobile-hud-reset,#configPage .big-buttons-toggle { min-height:44px!important;height:44px!important;margin:0!important; }
#configPage .desktop-control-picker { margin:0!important;min-width:0; }
#configPage .desktop-control-picker [role="group"] { min-width:0; }
#configPage .desktop-control-picker button { min-height:44px!important; }

/* Palette, previews, skill cards and NPC counters use the same map backdrop. */
#outfitPage .outfit-shared-palette,#outfitPage .outfit-detail-figure,
#outfitPage .outfit-wallet,#outfitPage .outfit-empty,
.skills-v81-modal__panel,.starter-v81__panel,.training-master__shell,
.skill-teacher__shell,.skill-teacher__detail,.craft-workshop > section {
  background:rgba(2,10,10,.38)!important;box-shadow:none!important;
}
#outfitPage button:not(.outfit-swatch),.skills-v81__card,.starter-v81__choice,
.skills-v81-modal button:not(.skills-v81__primary),
.skills-v81-modal__requirements,.starter-v81__reward,.starter-v81__weapon-icon {
  background:rgba(2,10,10,.32)!important;
}
#outfitPage button:not(.outfit-swatch):is(:hover,:focus-visible,.active,.selected),
.skills-v81__card:hover { background:rgba(235,215,136,.14)!important; }
.skills-v81-modal,.starter-v81 { background:rgba(2,9,8,.72)!important; }
.skill-teacher,.craft-workshop { background:rgba(2,9,8,.68)!important; }
.skill-teacher button,.skill-teacher__card,.craft-workshop button { background:rgba(2,10,10,.32)!important; }
.skill-teacher__card.is-selected { background:rgba(235,215,136,.14)!important; }
#outfitCategoriesPanel { grid-template-rows:minmax(0,1fr)!important; }
#outfitCategoriesPanel .outfit-pagination[hidden] { display:none!important; }
#outfitCategoryGrid { grid-template-columns:repeat(var(--outfit-category-columns,3),minmax(0,1fr))!important;grid-template-rows:repeat(var(--outfit-category-rows,5),minmax(0,1fr))!important; }
#outfitPage .outfit-category { min-height:44px!important; }

/* Material slots are the backpack's icon cards, with the same inspection modal. */
#gameMenu #inventoryPage[hidden],#gameMenu #configPage[hidden],#gameMenu #merchantPage[hidden] { display:none!important; }
#gameMenu:has(#merchantPage:not([hidden])) { padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;background:rgba(2,9,8,.57)!important; }
#gameMenu:has(#merchantPage:not([hidden])) > .game-menu-window { display:block!important;width:100%!important;height:100%!important;max-height:100%!important;max-width:1100px!important;min-height:0!important;background:transparent!important;padding:6px!important;overflow:hidden!important; }
#gameMenu #merchantPage:not([hidden]) { display:grid!important;grid-template-rows:26px 44px minmax(0,1fr)!important;gap:6px!important;height:100%!important;min-height:0!important;overflow:hidden!important;background:transparent!important;padding:0!important; }
#merchantTitle { margin:0!important;font-size:20px!important;line-height:24px!important;padding-right:42px!important; }
.merchant-view-tabs { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-width:420px;width:100%;justify-self:center; }
.merchant-view-tabs button { min-height:44px;background:rgba(2,10,10,.32);border:2px solid #8caaa6;color:#fff;font:800 14px system-ui;cursor:pointer; }
.merchant-view-tabs button[aria-selected="true"] { border-color:#e7d184;background:rgba(235,215,136,.14); }
#merchantPage .merchant-layout { display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;height:100%!important;min-height:0!important;overflow:hidden!important;padding:0!important; }
#merchantPage .merchant-buy-panel,#merchantPage .merchant-sell-panel { display:grid!important;grid-template-rows:24px minmax(0,1fr) 44px!important;gap:6px!important;min-height:0!important;height:100%!important;overflow:hidden!important;background:transparent!important;padding:0!important; }
#merchantPage .merchant-buy-panel[hidden],#merchantPage .merchant-sell-panel[hidden] { display:none!important; }
#merchantPage .merchant-heading { height:24px;margin:0!important;align-items:center; }
#merchantPage .merchant-heading h3,#merchantPage .merchant-sell-panel > h3 { margin:0;font-size:16px!important; }
#merchantPage #merchantBuyGrid,#merchantPage #merchantSellGrid { display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;grid-template-rows:repeat(var(--merchant-grid-rows,4),minmax(0,1fr))!important;height:100%!important;min-height:0!important;overflow:hidden!important;gap:6px!important; }
#merchantPage .merchant-inventory-slot { position:relative;display:grid;place-items:center;min-height:0!important;min-width:0!important;width:100%;height:100%;padding:4px;border:1px solid #b3c6be66;background:rgba(2,10,10,.32)!important;color:#fff;cursor:pointer; }
#merchantPage .merchant-inventory-slot:focus-visible,#merchantPage .merchant-inventory-slot:is(:hover,.selected) { outline:2px solid #e7d184;outline-offset:-3px; }
#merchantPage .merchant-inventory-slot .item-icon { width:clamp(26px,5vmin,52px)!important;height:clamp(26px,5vmin,52px)!important;max-width:82%;max-height:80%; }
.merchant-slot-price { position:absolute;bottom:3px;right:4px;font:800 11px/1 system-ui;text-shadow:1px 1px #000; }
.merchant-slot-amount { position:absolute;top:3px;right:4px;max-width:100%;font:800 12px/1 system-ui;text-shadow:1px 1px #000; }
.merchant-pagination { display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;align-items:center;max-width:420px;width:100%;justify-self:center; }
.merchant-pagination button { height:44px;min-height:44px;color:#fff;background:rgba(2,10,10,.35);border:1px solid #aec3b5;font:800 24px system-ui;cursor:pointer; }
.merchant-pagination button:disabled { opacity:.4;cursor:default; }
.merchant-pagination strong { text-align:center;font:700 12px system-ui;color:#e9e4cc; }
.merchant-grid-empty { grid-column:1/-1;grid-row:1/-1;align-self:center;text-align:center; }
.merchant-purchase-modal[hidden] { display:none!important; }
.merchant-purchase-modal { position:absolute;inset:0;z-index:1800;display:grid;place-items:center;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:rgba(2,9,8,.70);color:#f1eedf;isolation:isolate; }
.merchant-purchase-card { box-sizing:border-box;width:min(680px,100%);max-height:100%;min-height:0;padding:18px;display:grid;gap:10px;border:8px solid transparent;border-image:url('assets/ui-v63/frame.png') 10 stretch;background:rgba(2,10,10,.35);overflow:hidden; }
.merchant-purchase-heading { display:grid;grid-template-columns:58px minmax(0,1fr) 44px;align-items:center;gap:9px; }
.merchant-purchase-heading h3 { font-size:22px;line-height:1.15;margin:0;overflow-wrap:anywhere; }
.merchant-purchase-icon { width:56px;height:56px;display:grid;place-items:center; }
.merchant-purchase-icon .item-icon { width:52px!important;height:52px!important;image-rendering:pixelated; }
.merchant-purchase-card p { margin:0;font-size:13px;line-height:1.35; }
.merchant-purchase-description { white-space:pre-line;min-height:0; }
.merchant-purchase-stats { color:#ccd9d0; }.merchant-purchase-stats[hidden] { display:none!important; }
.merchant-purchase-unit { color:#e2ce88; }
.merchant-purchase-available { color:#ccd9d0; }
.merchant-purchase-quantity { display:grid;grid-template-columns:minmax(0,1fr) 86px;align-items:center;gap:4px 10px;font:700 14px system-ui; }
.merchant-purchase-quantity .merchant-quantity-number { width:100%;min-width:0;height:44px;box-sizing:border-box;border:1px solid #a5bdae;background:rgba(0,0,0,.28);color:#fff;font:800 18px system-ui;text-align:center; }
.merchant-purchase-quantity .merchant-quantity-slider { grid-column:1/-1;width:100%;height:36px;margin:0;accent-color:#e8d187;cursor:ew-resize;touch-action:pan-y; }
.merchant-quantity-range { grid-column:1/-1;text-align:right;font-size:11px;color:#ccd9d0; }
.merchant-purchase-total { color:#f4df9b;font-size:17px; }
.merchant-purchase-feedback:empty { display:none; }.merchant-purchase-feedback { color:#ffd1ba; }
.merchant-purchase-actions { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
.merchant-purchase-card button { min-height:44px;background:rgba(2,10,10,.35);border:1px solid #aec3b5;color:#fff;font:800 14px system-ui;cursor:pointer; }
.merchant-purchase-card button:disabled { opacity:.55;cursor:default; }.merchant-purchase-actions button:first-child { border-color:#e8d187;color:#ffefb3; }
#merchantPage :focus-visible,.merchant-purchase-card :focus-visible { outline:2px solid #e8d187;outline-offset:-3px; }
@media(max-width:420px) { #merchantPage #merchantBuyGrid,#merchantPage #merchantSellGrid { grid-template-columns:repeat(5,minmax(0,1fr))!important; }.merchant-purchase-card { padding:9px;gap:8px; }.merchant-purchase-heading h3 { font-size:18px; } }
@media(max-height:420px) and (min-width:421px) {
  .merchant-purchase-card { padding:8px;gap:5px 14px;grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .merchant-purchase-heading { grid-column:1/-1;grid-template-columns:42px minmax(0,1fr) 44px; }
  .merchant-purchase-heading h3 { font-size:18px; }
  .merchant-purchase-icon,.merchant-purchase-icon .item-icon { width:40px!important;height:40px!important; }
  .merchant-purchase-description { grid-column:1;grid-row:2/6;font-size:12px!important; }
  .merchant-purchase-stats { grid-column:1;grid-row:6;font-size:11px!important; }
  .merchant-purchase-unit { grid-column:2;grid-row:2; }.merchant-purchase-available { grid-column:2;grid-row:3; }
  .merchant-purchase-quantity { grid-column:2;grid-row:4; }.merchant-purchase-total { grid-column:2;grid-row:5; }
  .merchant-purchase-actions,.merchant-purchase-feedback { grid-column:1/-1; }.merchant-purchase-card p { font-size:12px; }
}

#gameMenu.standard-menu-open #inventoryPage:not([hidden]):has(#inventoryMaterialsTabPanel:not([hidden])) { display:grid!important;grid-template-rows:44px minmax(0,1fr)!important;gap:5px!important;overflow:hidden!important; }
#inventoryPage:not([hidden]):has(#inventoryMaterialsTabPanel:not([hidden])) > .inventory-tabs-content { height:100%!important;min-height:0!important;overflow:hidden!important; }
#inventoryPage:not([hidden]):has(#inventoryMaterialsTabPanel:not([hidden])) > .inventory-tabs { min-height:44px!important;height:44px!important;margin:0!important; }
#inventoryPage:not([hidden]):has(#inventoryMaterialsTabPanel:not([hidden])) > .inventory-tabs button { height:44px!important;min-height:44px!important; }
#gameMenu.standard-menu-open #inventoryMaterialsTabPanel:not([hidden]) { display:grid!important;height:100%!important;overflow:hidden!important;min-height:0!important; }
#inventoryMaterialsTabPanel .material-pouch { display:grid!important;grid-template-rows:auto auto minmax(0,1fr) 44px!important;min-height:0!important;height:100%!important;overflow:hidden!important;background:transparent!important;padding:6px!important;gap:6px!important; }
#inventoryMaterialsTabPanel .material-pouch-heading { grid-row:1;margin:0!important;align-items:center; }
#inventoryMaterialsTabPanel .material-pouch-heading h3 { margin:0!important;font-size:clamp(16px,2vw,24px)!important; }
#inventoryMaterialsTabPanel .material-pouch-heading small { display:none; }
#inventoryMaterialsTabPanel .material-pouch-help { grid-row:2;margin:0!important;font-size:12px!important; }
#inventoryMaterialsTabPanel .material-pouch-pagination { grid-row:4;margin:0!important;min-height:44px!important;display:flex;justify-content:center;align-items:center;gap:14px; }
#inventoryMaterialsTabPanel .material-pouch-pagination button { width:44px!important;height:44px!important;min-height:44px!important; }
#inventoryMaterialsTabPanel #materialPouchGrid { grid-row:3;display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;grid-template-rows:repeat(var(--material-inventory-rows,4),minmax(0,1fr))!important;gap:clamp(4px,.7vw,8px)!important;min-width:0!important;min-height:0!important;width:min(100%,1100px)!important;height:100%!important;justify-self:center;overflow:hidden!important; }
#materialPouchGrid .inventory-slot { display:grid!important;place-items:center!important;position:relative;min-width:0!important;min-height:0!important;height:100%!important;width:100%!important;padding:5px!important;border:1px solid rgba(255,255,255,.3)!important;border-radius:5px!important;background:rgba(2,10,10,.36)!important; }
#materialPouchGrid .inventory-slot.occupied { cursor:pointer; }
#materialPouchGrid .inventory-slot.selected,#materialPouchGrid .inventory-slot:focus-visible { border-color:#e5d38b!important;outline:2px solid #e5d38b;outline-offset:-3px; }
#materialPouchGrid .inventory-slot .item-icon { width:clamp(24px,5vmin,52px)!important;height:clamp(24px,5vmin,52px)!important;max-width:85%!important;max-height:82%!important;image-rendering:pixelated; }
#materialPouchGrid .inventory-stack-count { position:absolute;right:4px;bottom:2px;color:#fff;font:800 clamp(10px,1.2vw,15px)/1.2 system-ui;text-shadow:1px 1px #000,-1px -1px #000;font-variant-numeric:tabular-nums; }
#materialPouchGrid .inventory-slot-number { opacity:.24;font-size:11px; }

@media(max-width:760px),(max-height:560px) {
  #gameMenu.standard-menu-open { padding:max(4px,env(safe-area-inset-top)) max(5px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left))!important; }
  #gameMenu.standard-menu-open > .game-menu-window { grid-template-rows:88px minmax(0,1fr)!important;padding:0 2px 2px!important;grid-template-columns:minmax(0,1fr)!important; }
  #gameMenu.standard-menu-open .legacy-menu-tabs { width:calc(100% - 46px)!important;height:84px!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;gap:4px!important;justify-self:start!important;overflow:hidden!important; }
  #gameMenu.standard-menu-open .legacy-menu-tabs .menu-tile { min-height:40px!important;height:40px!important;padding:2px 3px!important;font:800 clamp(9px,2.7vw,13px)/1.05 system-ui!important; }
  #gameMenu.standard-menu-open .legacy-menu-tabs .menu-tile strong { font:inherit!important;white-space:nowrap;letter-spacing:-.02em; }
  #gameMenu.standard-menu-open .menu-back-button { width:40px!important;height:40px!important;right:max(5px,env(safe-area-inset-right))!important;top:max(5px,env(safe-area-inset-top))!important; }
  #gameMenu.standard-menu-open > .game-menu-window > .menu-page:not([hidden]) { padding:4px!important;min-width:0!important;max-width:100%!important; }
  #gameMenu.standard-menu-open > .game-menu-window > #configPage:not([hidden]) { gap:6px!important; }
  #outfitPage .outfit-heading p,#outfitPage .outfit-wallet small,#outfitPage .outfit-preview figcaption { display:none!important; }
  #outfitPage .outfit-heading h2 { font-size:20px!important; }
  #outfitPage .outfit-heading { gap:5px; }
  #outfitPage .outfit-wallet { padding:3px 5px; }
  #outfitPage .outfit-footer { grid-template-columns:minmax(60px,1fr) minmax(80px,160px) minmax(60px,1fr)!important;gap:4px!important;padding-top:3px!important; }
  #outfitPage .outfit-preview { grid-column:2!important;grid-row:1!important; }
  #outfitPage .outfit-preview canvas { height:44px!important; }
  #outfitPage .outfit-bottom-tab:first-child { grid-column:1!important;grid-row:1!important; }
  #outfitPage .outfit-bottom-tab:last-of-type { grid-column:3!important;grid-row:1!important; }
  #outfitPage .outfit-bottom-tab { min-height:44px!important;height:44px!important;padding:5px!important;font-size:14px!important; }
  #outfitPage .outfit-category { padding:4px!important;gap:5px!important; }
  #outfitPage .outfit-category-copy strong { font-size:12px!important; }
  #outfitPage .outfit-category-copy small,#outfitPage .outfit-category-chevron { display:none!important; }
  #outfitPage .outfit-category-icon { max-width:26px!important;max-height:38px!important; }
  #outfitPage .outfit-color-rows { gap:7px!important; }
  #outfitPage .outfit-color-selectors { grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important; }
  #outfitPage .outfit-channel { min-height:44px!important;height:44px!important;padding:5px!important; }
  #outfitPage .outfit-color-number { width:23px;height:23px; }
  #outfitPage .outfit-channel strong { font-size:12px!important; }
  #outfitPage .outfit-shared-palette { padding:6px!important;gap:5px!important; }
  #outfitPage .outfit-swatch { min-height:44px!important;height:44px!important; }
  #outfitPage .outfit-color-note { display:none!important; }
  #inventoryMaterialsTabPanel .material-pouch-help { display:none!important; }
  #inventoryMaterialsTabPanel .material-pouch { grid-template-rows:auto minmax(0,1fr) 44px!important;gap:5px!important;padding:2px!important; }
  #inventoryMaterialsTabPanel #materialPouchGrid { grid-row:2; }
  #inventoryMaterialsTabPanel .material-pouch-pagination { grid-row:3; }
  #inventoryMaterialsTabPanel .material-pouch-heading strong { font-size:11px!important; }
}
@media(max-width:420px) and (min-height:421px) {
  #inventoryMaterialsTabPanel #materialPouchGrid { grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(var(--material-inventory-rows,4),minmax(0,1fr))!important; }
}
@media(max-height:420px) and (min-width:421px) {
  #gameMenu.standard-menu-open > .game-menu-window { grid-template-rows:70px minmax(0,1fr)!important; }
  #gameMenu.standard-menu-open .legacy-menu-tabs { height:66px!important;gap:3px!important; }
  #gameMenu.standard-menu-open .legacy-menu-tabs .menu-tile { min-height:31px!important;height:31px!important;font-size:11px!important; }
  #gameMenu.standard-menu-open .menu-back-button { width:36px!important;height:36px!important; }
  #gameMenu.standard-menu-open > .game-menu-window > #configPage:not([hidden]) { grid-template-rows:40px minmax(0,1fr)!important;gap:3px!important; }
  #configPage .config-subtabs button { min-height:40px!important; }
  #configPage .config-modern-view[data-config-panel="audio"] { grid-template-columns:repeat(3,minmax(0,1fr));gap:10px!important; }
  #configPage [data-config-panel="audio"] .five-step-setting { grid-template-columns:44px minmax(0,1fr) 44px!important;grid-template-rows:auto auto;gap:6px!important; }
  #configPage [data-config-panel="audio"] .five-step-setting > strong { grid-column:1/-1;text-align:center;font-size:13px!important; }
  #configPage [data-config-panel="audio"] .five-step-setting .step-squares { grid-column:2;gap:2px!important; }
  #configPage [data-config-panel="audio"] .five-step-setting > button[data-step="-1"] { grid-column:1;grid-row:2; }
  #configPage [data-config-panel="audio"] .five-step-setting > button[data-step="1"] { grid-column:3;grid-row:2; }
  #configPage .config-modern-view[data-config-panel="controls"] { grid-template-columns:repeat(2,minmax(0,1fr));gap:6px!important; }
  #configPage [data-config-panel="controls"] .five-step-setting { grid-template-columns:minmax(40px,1fr) 40px minmax(60px,1.4fr) 40px!important;gap:4px!important; }
  #configPage [data-config-panel="controls"] .five-step-setting > button { width:40px!important;height:40px!important;min-height:40px!important; }
  #configPage .desktop-control-picker { grid-column:1/-1; }
  #outfitPage .outfit-heading h2 { font-size:17px!important; }
  #outfitPage .outfit-color-rows { grid-template-columns:minmax(0,1fr)!important;gap:4px!important; }
  #outfitPage .outfit-color-selectors { grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important; }
  #outfitPage .outfit-color-number { display:none!important; }
  #outfitPage .outfit-shared-palette { padding:0!important;background:transparent!important;border:0; }
  #outfitPage .outfit-palette { grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:4px!important; }
  #outfitPage .outfit-palette-caption { display:none!important; }
  #outfitPage .outfit-category-copy strong { font-size:10px!important; }
  #outfitPage .outfit-category-icon,#outfitPage .outfit-category-avatar { max-width:20px!important;max-height:30px!important; }
  #outfitPage .outfit-category { gap:3px!important; }
}

/* V91: landscape menus share one finite canvas. Browser chrome changes the
   visual viewport; the game fitter supplies its height without scaling text. */
#gameMenu.standard-menu-open {
  --menu-nav-height:clamp(92px,14dvh,138px);
  box-sizing:border-box!important;
  max-height:var(--menu-viewport-height,100dvh)!important;
  overflow:hidden!important;
  touch-action:manipulation!important;
}
#gameMenu.standard-menu-open > .game-menu-window {
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-rows:var(--menu-nav-height) minmax(0,1fr)!important;
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;height:100%!important;
  max-width:none!important;max-height:none!important;
  min-width:0!important;min-height:0!important;
  overflow:hidden!important;
  align-content:stretch!important;
}
#gameMenu.standard-menu-open .legacy-menu-tabs {
  box-sizing:border-box!important;
  height:calc(var(--menu-nav-height) - 5px)!important;
  min-height:0!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  align-content:stretch!important;
}
#gameMenu.standard-menu-open .legacy-menu-tabs .menu-tile {
  height:100%!important;min-height:0!important;
  min-width:0!important;
}
#gameMenu.standard-menu-open > .game-menu-window > .menu-page:not([hidden]) {
  box-sizing:border-box!important;
  grid-row:2!important;
  height:100%!important;max-height:100%!important;
  min-height:0!important;min-width:0!important;
  overflow:hidden!important;scrollbar-gutter:auto!important;
  overscroll-behavior:none!important;
}
#gameMenu.standard-menu-open .legacy-menu-tabs .menu-tile strong {
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#gameMenu.standard-menu-open.friends-menu-open > .game-menu-window { grid-template-rows:minmax(0,1fr)!important; }
#gameMenu.standard-menu-open.friends-menu-open > .game-menu-window > #friendsPage:not([hidden]) { grid-row:1!important; }
#configPage .config-modern-view:not([hidden]) {
  box-sizing:border-box!important;
  max-height:100%!important;
  grid-auto-rows:max-content;
  justify-content:center!important;
}
#configPage .step-squares {
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  align-items:center!important;
  min-height:0!important;min-width:0!important;
  height:36px!important;max-width:260px!important;
}
#configPage .step-square {
  appearance:none!important;-webkit-appearance:none!important;
  box-sizing:border-box!important;
  width:100%!important;height:100%!important;
  min-height:0!important;min-width:0!important;
  max-width:44px!important;max-height:36px!important;
  aspect-ratio:auto!important;
  padding:0!important;border:1px solid #94aaa5!important;
  border-radius:2px!important;
  background:rgba(2,10,10,.42)!important;
  box-shadow:inset 0 0 0 1px #03090866!important;
  cursor:pointer;
}
#configPage .step-square.filled {
  border-color:#e5d08d!important;
  background:rgba(202,173,86,.7)!important;
}
#configPage .step-square.selected { outline:2px solid #ffe9a6;outline-offset:-3px; }
#configPage .big-buttons-toggle {
  min-width:0!important;max-width:100%!important;
  font-size:14px!important;gap:8px!important;padding:4px 8px!important;
  justify-self:center!important;
}
#configPage .big-buttons-toggle > span {
  box-sizing:border-box;width:24px!important;height:24px!important;
  border-width:1px!important;border-color:#a9bbb4!important;
}
#configPage .big-buttons-toggle[aria-pressed="true"] > span { background:#d9c479!important; }
#configPage .desktop-control-picker {
  width:min(680px,100%)!important;height:auto!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;align-self:center!important;
}
#configPage .desktop-control-picker > button {
  grid-template-columns:42px minmax(0,1fr)!important;
  min-height:70px!important;padding:8px!important;gap:8px!important;
}
#configPage .desktop-control-picker strong { font-size:14px!important; }
#configPage .desktop-control-picker small { font-size:11px!important; }
#configPage .desktop-control-picker > :is(small,h3,[role="group"]) { grid-column:1/-1!important;min-width:0!important; }
#configPage .desktop-control-picker > :is(small,h3) { margin:0!important;text-align:center!important; }
#configPage .desktop-control-picker > [role="group"] {
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;min-height:0!important;
}
#configPage .desktop-control-picker [role="group"] > button {
  display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;
  min-width:0!important;padding:8px!important;gap:8px!important;align-items:center!important;
}

@media (orientation:landscape) and (max-height:560px) {
  #gameMenu.standard-menu-open { --menu-nav-height:clamp(66px,19dvh,88px); }
  #gameMenu.standard-menu-open > .game-menu-window {
    padding:0 2px 2px!important;
  }
  #gameMenu.standard-menu-open .legacy-menu-tabs {
    width:calc(100% - 42px)!important;
    justify-self:start!important;
    gap:3px!important;
  }
  #gameMenu.standard-menu-open .legacy-menu-tabs .menu-tile {
    padding:2px 5px!important;
    font:800 clamp(10px,2.9dvh,14px)/1.05 system-ui!important;
  }
  #gameMenu.standard-menu-open .menu-back-button {
    width:36px!important;height:36px!important;
  }
  #gameMenu.standard-menu-open > .game-menu-window > .menu-page:not([hidden]) {
    padding:3px!important;
  }
  #gameMenu.standard-menu-open > .game-menu-window > #configPage:not([hidden]) {
    grid-template-rows:36px minmax(0,1fr)!important;gap:4px!important;
  }
  #configPage .config-subtabs { width:min(560px,100%)!important;gap:5px!important; }
  #configPage .config-subtabs button { height:36px!important;min-height:36px!important;font-size:13px!important; }
  #configPage .config-modern-view:not([hidden]) { gap:8px!important; }
  #configPage .config-modern-view[data-config-panel="audio"] {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:min(850px,100%)!important;
  }
  #configPage [data-config-panel="audio"] .five-step-setting {
    grid-template-columns:34px minmax(0,1fr) 34px!important;
    grid-template-rows:20px 34px!important;gap:6px!important;
  }
  #configPage [data-config-panel="audio"] .five-step-setting > strong { grid-column:1/-1;text-align:center;font-size:13px!important; }
  #configPage [data-config-panel="audio"] .five-step-setting > button[data-step="-1"] { grid-column:1;grid-row:2; }
  #configPage [data-config-panel="audio"] .five-step-setting > button[data-step="1"] { grid-column:3;grid-row:2; }
  #configPage [data-config-panel="audio"] .step-squares { grid-column:2;grid-row:2; }
  #configPage .config-modern-view[data-config-panel="controls"] {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:auto auto!important;
    width:min(830px,100%)!important;gap:12px 16px!important;
  }
  #configPage [data-config-panel="controls"] .five-step-setting {
    grid-template-columns:34px minmax(0,1fr) 34px!important;
    grid-template-rows:20px 34px!important;gap:5px!important;
  }
  #configPage [data-config-panel="controls"] .five-step-setting > strong { grid-column:1/-1;text-align:center;font-size:13px!important; }
  #configPage [data-config-panel="controls"] .five-step-setting > button[data-step="-1"] { grid-column:1;grid-row:2; }
  #configPage [data-config-panel="controls"] .five-step-setting > button[data-step="1"] { grid-column:3;grid-row:2; }
  #configPage [data-config-panel="controls"] .step-squares { grid-column:2;grid-row:2;justify-self:center;width:100%; }
  #configPage .five-step-setting > button { width:34px!important;height:34px!important;min-height:34px!important;font-size:23px!important; }
  #configPage .step-squares,#configPage .step-square { height:32px!important;max-height:32px!important;gap:4px!important; }
  #configPage .big-buttons-toggle,#configPage .mobile-hud-reset { height:36px!important;min-height:36px!important;align-self:center!important; }
  #configPage .mobile-hud-reset { justify-self:center!important;font-size:12px!important;padding:4px 12px!important; }
  #configPage .desktop-control-picker { grid-column:1/-1!important;grid-row:1/-1!important; }
  #configPage .desktop-control-picker > button { min-height:60px!important; }
  #configPage .desktop-control-picker {
    box-sizing:border-box!important;height:min(130px,100%)!important;max-height:100%!important;
    grid-template-rows:16px 24px minmax(0,1fr)!important;gap:6px!important;min-height:0!important;
  }
  #configPage .desktop-control-picker > small { line-height:16px!important; }
  #configPage .desktop-control-picker > h3 { font-size:18px!important;line-height:24px!important; }
  #configPage .desktop-control-picker [role="group"] > button {
    box-sizing:border-box!important;height:100%!important;min-height:0!important;max-height:100%!important;
    grid-template-columns:32px minmax(0,1fr)!important;padding:5px 7px!important;
  }

  /* Identity and support forms keep every field and action in two columns. */
  #gameMenu.standard-menu-open #accountPage:not([hidden]),
  #gameMenu.standard-menu-open #supportPage:not([hidden]),
  #gameMenu.standard-menu-open #socialPage:not([hidden]) {
    display:grid!important;grid-template-rows:24px minmax(0,1fr)!important;gap:4px!important;
  }
  #gameMenu :is(#accountPage,#supportPage,#socialPage) > h2 { margin:0!important;line-height:24px!important;font-size:19px!important; }
  #gameMenu :is(#accountPage,#supportPage,#socialPage) .account-layout {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    min-height:0!important;height:100%!important;gap:7px!important;
    overflow:hidden!important;
  }
  #gameMenu :is(#accountPage,#supportPage,#socialPage) .account-card {
    box-sizing:border-box!important;min-width:0!important;min-height:0!important;
    padding:6px 8px!important;gap:5px!important;
    align-content:start!important;overflow:hidden!important;
    background:rgba(2,10,10,.34)!important;
  }
  #gameMenu #socialPage .account-layout { grid-template-columns:repeat(3,minmax(0,1fr))!important; }
  #gameMenu .account-state strong { font-size:13px!important; }
  #gameMenu .account-state small { display:none!important; }
  #gameMenu .account-card label { font-size:11px!important; }
  #gameMenu .account-card :is(input,textarea) { box-sizing:border-box!important;min-height:30px!important;height:30px!important;font-size:12px!important;padding:4px 6px!important;margin-top:2px!important; }
  #gameMenu .account-card button { min-height:32px!important;height:32px!important;padding:4px 7px!important;font-size:11px!important; }
  #gameMenu .account-feedback { min-height:0!important;font-size:11px!important; }
  #gameMenu .account-feedback:empty { display:none!important; }
  #gameMenu .account-legal-links { gap:12px!important; }
  #gameMenu .account-legal-links a { font-size:11px!important; }
  #gameMenu .account-card--danger p { font-size:11px!important;line-height:1.2!important; }
  #gameMenu .identity-row { min-width:0!important;gap:6px!important; }

  /* Stats remain legible: four cards, bounded headings and compact rows. */
  #gameMenu.standard-menu-open #statusPage:not([hidden]) {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:28px minmax(0,1fr)!important;
    padding-bottom:4px!important;gap:4px 10px!important;
  }
  #gameMenu #statusPage .status-page-heading { min-height:28px!important;align-items:center!important; }
  #gameMenu #statusPage .status-page-heading > .status-page-arrow {
    position:absolute!important;right:4px!important;top:0!important;bottom:auto!important;
    height:28px!important;min-height:28px!important;width:34px!important;min-width:34px!important;font-size:24px!important;
  }
  #gameMenu #statusPage .status-dashboard { grid-template-columns:minmax(0,1fr)!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;gap:5px!important; }
  #gameMenu #statusPage .status-card { padding:4px 6px!important; }
  #gameMenu #statusPage .status-card h3 { font-size:11px!important;line-height:13px!important; }
  #gameMenu #statusPage .status-group { grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:1px 8px!important; }
  #gameMenu #statusPage .status-group > div { font-size:11px!important;line-height:12px!important;padding:0!important;gap:3px!important; }
  #gameMenu #statusPage .status-group :is(dt,dd) { font-size:11px!important;line-height:12px!important; }
  #gameMenu #statusPage .status-group .status-detail { grid-template-columns:minmax(0,1fr)!important;grid-column:1/-1!important; }
  #gameMenu #statusPage .status-group .status-detail dd { font-size:10px!important;line-height:11px!important; }

  #gameMenu.standard-menu-open #attributesPage:not([hidden]) { grid-template-rows:28px minmax(0,1fr)!important;gap:5px!important; }
  #gameMenu #attributesPage .attribute-page-heading { min-height:28px!important;align-items:center!important; }
  #gameMenu #attributesPage .attribute-page-heading .attribute-page-arrow {
    position:absolute!important;right:4px!important;top:0!important;bottom:auto!important;
    height:28px!important;min-height:28px!important;width:34px!important;min-width:34px!important;font-size:24px!important;
  }
  #gameMenu #attributesPage .attribute-panel--qol {
    width:100%!important;padding:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:30px repeat(3,minmax(0,1fr)) 34px!important;
    gap:4px 10px!important;
  }
  #gameMenu #attributesPage .attribute-points-heading { grid-row:1!important; }
  #gameMenu #attributesPage .attribute-row { padding:3px 8px!important;gap:6px!important; }
  #gameMenu #attributesPage .attribute-row :is(strong,b) { font-size:13px!important; }
  #gameMenu #attributesPage .attribute-add-button { width:30px!important;height:30px!important;font-size:22px!important; }
  #gameMenu #attributesPage .attribute-allocation-control {
    position:absolute!important;left:50%!important;bottom:0!important;
  }
  #gameMenu #attributesPage .attribute-allocation-control > div { gap:5px!important; }
  #gameMenu #attributesPage .attribute-allocation-control :is(button,input) { width:36px!important;height:32px!important;font-size:13px!important; }
  #gameMenu #attributesPage .attribute-reset-button { bottom:0!important;left:0!important;height:32px!important;min-height:32px!important;padding:0 10px!important; }
  #gameMenu #attributesPage .attribute-summary { height:100%!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;gap:5px!important; }
  #gameMenu #attributesPage .attribute-summary > div { min-width:0!important;min-height:0!important;padding:3px 6px!important; }
  #gameMenu #attributesPage .attribute-summary dt { font-size:11px!important; }
  #gameMenu #attributesPage .attribute-summary dd { font-size:14px!important; }
  #gameMenu #attributesPage .attribute-derived-heading { display:none!important; }

  /* Shop has six choices; their rows share available space rather than vh. */
  #gameMenu #storePage[data-store-mode="diamonds"] .store-diamonds-view:not([hidden]) { padding:4px!important; }
  #gameMenu #storePage[data-store-mode="diamonds"] .store-diamonds-view:not([hidden]) {
    box-sizing:border-box!important;display:grid!important;
    grid-template-rows:32px minmax(0,1fr)!important;gap:6px!important;
  }
  #gameMenu #storePage .store-mount-link { height:32px!important;min-height:32px!important;margin:0!important; }
  #gameMenu #storePage[data-store-mode="diamonds"] .diamond-package-grid {
    height:100%!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px 12px!important;
  }
  #gameMenu #storePage .diamond-package-action { padding:5px 9px!important;gap:3px 8px!important; }
  #gameMenu #storePage .diamond-package-title { font-size:13px!important; }
  #gameMenu #storePage .diamond-package-bonus { font-size:11px!important; }
  #gameMenu #storePage .diamond-package-price { font-size:14px!important; }

  #gameMenu.standard-menu-open #creditsPage:not([hidden]) {
    display:grid!important;grid-template-rows:36px minmax(0,1fr)!important;gap:4px!important;
  }
  #gameMenu #creditsPage .skill-tree-header { box-sizing:border-box!important;min-height:0!important;height:36px!important;padding:3px 6px!important;gap:6px!important; }
  #gameMenu #creditsPage .skill-tree-header h2 { font-size:17px!important;line-height:19px!important; }
  #gameMenu #creditsPage .skill-tree-header small { font-size:10px!important;line-height:11px!important;margin:0!important; }
  #gameMenu #creditsPage .skill-domain-browser:not([hidden]) {
    box-sizing:border-box!important;display:grid!important;
    grid-template-rows:minmax(0,1fr) 30px!important;
    height:100%!important;min-height:0!important;max-height:100%!important;
    padding:0!important;gap:5px!important;overflow:hidden!important;
  }
  #gameMenu #creditsPage .skill-domain-grid {
    box-sizing:border-box!important;display:grid!important;height:100%!important;min-height:0!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;gap:5px!important;
  }
  #gameMenu #creditsPage .skill-domain-card { min-height:0!important;min-width:0!important;padding:3px 6px!important;gap:2px!important; }
  #gameMenu #creditsPage .skill-domain-card strong { font-size:12px!important;line-height:14px!important; }
  #gameMenu #creditsPage .skill-domain-card small { font-size:10px!important;line-height:11px!important; }
  #gameMenu #creditsPage .skill-domain-card em { display:none!important; }
  #gameMenu #creditsPage .skill-domain-pagination { height:30px!important;min-height:0!important;gap:16px!important; }
  #gameMenu #creditsPage .skill-domain-pagination button { height:30px!important;min-height:30px!important;font-size:24px!important; }
}

/* The GM catalogue follows the same finite layout: separate pages for item
   cards and categories retain all grants and search without an endless list. */
#gameMenu.admin-menu-open {
  box-sizing:border-box!important;padding:5px!important;overflow:hidden!important;
  max-height:var(--menu-viewport-height,100dvh)!important;
  background:rgba(2,9,8,.57)!important;
}
#gameMenu.admin-menu-open > .game-menu-window {
  box-sizing:border-box!important;display:grid!important;
  grid-template-rows:minmax(0,1fr)!important;grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;height:100%!important;max-width:1280px!important;max-height:100%!important;
  min-height:0!important;padding:4px 40px 4px 4px!important;overflow:hidden!important;
  background:transparent!important;
}
#gameMenu.admin-menu-open .legacy-menu-tabs { display:none!important; }
#gameMenu.admin-menu-open > .game-menu-window > #adminInventoryPage:not([hidden]) {
  box-sizing:border-box!important;display:grid!important;
  grid-template-rows:42px 48px minmax(0,1fr)!important;
  width:100%!important;height:100%!important;max-height:100%!important;
  min-height:0!important;min-width:0!important;gap:6px!important;
  padding:0!important;overflow:hidden!important;
}
#gameMenu #adminInventoryPage .admin-inventory-heading { margin:0!important;gap:8px!important; }
#gameMenu #adminInventoryPage .admin-inventory-heading h2 { margin:0!important;font-size:20px!important; }
#gameMenu #adminInventoryPage .admin-inventory-heading p { display:none!important; }
#gameMenu #adminInventoryPage .admin-resource-actions { gap:6px!important;flex-wrap:nowrap!important; }
#gameMenu #adminInventoryPage .admin-resource-actions button { min-height:32px!important;padding:4px 8px!important;font-size:12px!important; }
#gameMenu #adminInventoryPage .admin-inventory-toolbar { min-width:0!important;margin:0!important;grid-template-columns:minmax(0,1fr) minmax(120px,.35fr)!important;gap:8px!important; }
#gameMenu #adminInventoryPage .admin-inventory-toolbar label { min-width:0!important;gap:2px!important;font-size:11px!important; }
#gameMenu #adminInventoryPage .admin-inventory-toolbar input { box-sizing:border-box!important;width:100%!important;min-width:0!important;height:32px!important;min-height:32px!important;padding:3px 6px!important;font-size:13px!important; }
#gameMenu #adminInventoryPage .admin-inventory-content {
  min-width:0!important;min-height:0!important;height:100%!important;
  display:grid!important;grid-template-columns:140px minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr) 30px!important;gap:6px 9px!important;
  overflow:hidden!important;
}
#gameMenu #adminInventoryCategories {
  box-sizing:border-box!important;grid-column:1!important;grid-row:1/-1!important;
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:repeat(var(--admin-category-rows,6),minmax(0,1fr)) 30px!important;
  min-height:0!important;min-width:0!important;height:100%!important;padding:4px!important;
  gap:4px!important;overflow:hidden!important;background:rgba(2,10,10,.32)!important;
}
#gameMenu #adminInventoryCategories .admin-inventory-category { min-width:0!important;min-height:0!important;height:100%!important;padding:3px 6px!important;font-size:12px!important; }
#gameMenu #adminInventoryCategories .admin-inventory-category span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
#gameMenu #adminInventoryGrid {
  box-sizing:border-box!important;grid-column:2!important;grid-row:1!important;
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(var(--admin-item-rows,4),minmax(0,1fr))!important;
  min-width:0!important;min-height:0!important;height:100%!important;max-height:100%!important;
  padding:0!important;gap:6px!important;overflow:hidden!important;
}
#gameMenu #adminInventoryGrid .admin-item-card {
  box-sizing:border-box!important;height:100%!important;min-width:0!important;min-height:0!important;
  grid-template-columns:32px minmax(0,1fr) 44px!important;gap:5px!important;padding:5px!important;
  background:rgba(2,10,10,.34)!important;overflow:hidden!important;
}
#gameMenu #adminInventoryGrid .admin-item-icon { width:30px!important;height:30px!important;max-width:100%!important;max-height:100%!important; }
#gameMenu #adminInventoryGrid .admin-item-card div { min-width:0!important;gap:2px!important; }
#gameMenu #adminInventoryGrid .admin-item-card strong { font-size:12px!important;line-height:14px!important; }
#gameMenu #adminInventoryGrid .admin-item-card small { font-size:10px!important;line-height:11px!important; }
#gameMenu #adminInventoryGrid .admin-item-card :is(strong,small) { display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden; }
#gameMenu #adminInventoryGrid .admin-item-card em { font-size:10px!important;line-height:11px!important; }
#gameMenu #adminInventoryGrid .admin-item-card button { min-height:30px!important;height:30px!important;padding:0 3px!important;font-size:9px!important; }
#gameMenu #adminInventoryGrid .admin-item-empty { grid-column:1/-1!important;grid-row:1/-1!important;min-height:0!important; }
#gameMenu #adminInventoryPage .admin-catalog-pagination { display:grid!important;grid-template-columns:28px minmax(0,1fr) 28px!important;gap:4px!important;align-items:center!important;min-width:0!important;min-height:0!important;height:30px!important; }
#gameMenu #adminInventoryPage .admin-catalog-pagination button { min-height:28px!important;height:28px!important;padding:0!important;font-size:23px!important; }
#gameMenu #adminInventoryPage .admin-catalog-pagination span { min-width:0!important;text-align:center;font:800 11px/1 system-ui;white-space:nowrap; }
#gameMenu #adminInventoryPage .admin-item-pagination { grid-column:2!important;grid-row:2!important;width:min(360px,100%)!important;justify-self:center!important; }
@media (orientation:landscape) and (max-height:420px) {
  #gameMenu.admin-menu-open > .game-menu-window > #adminInventoryPage:not([hidden]) { grid-template-rows:32px 45px minmax(0,1fr)!important;gap:4px!important; }
  #gameMenu #adminInventoryPage .admin-inventory-heading h2 { font-size:17px!important; }
  #gameMenu #adminInventoryPage .admin-resource-actions button { min-height:28px!important;font-size:10px!important;padding:3px 5px!important; }
  #gameMenu #adminInventoryPage .admin-inventory-content { grid-template-columns:122px minmax(0,1fr)!important;gap:5px!important; }
  #gameMenu #adminInventoryGrid .admin-item-card { grid-template-columns:24px minmax(0,1fr) 38px!important;padding:3px!important;gap:3px!important; }
  #gameMenu #adminInventoryGrid .admin-item-icon { width:24px!important;height:24px!important; }
  #gameMenu #adminInventoryGrid .admin-item-card strong { font-size:10px!important;line-height:12px!important; }
  #gameMenu #adminInventoryGrid .admin-item-card small { font-size:9px!important;line-height:10px!important; }
  #gameMenu #adminInventoryGrid .admin-item-card em { font-size:9px!important;line-height:10px!important; }
  #gameMenu #adminInventoryGrid .admin-item-card button { font-size:8px!important; }
  #gameMenu #adminInventoryCategories .admin-inventory-category { font-size:11px!important; }
}

/* Social sections and player lists use explicit pages. A guild with many
   members has the same screen footprint as a guild with one member. */
#gameMenu #socialPage:not([hidden]) {
  display:grid!important;grid-template-rows:24px 34px minmax(0,1fr)!important;gap:5px!important;
}
#gameMenu #socialPage > h2 { margin:0!important;font-size:19px!important;line-height:24px!important; }
#gameMenu #socialPage .social-panel-tabs {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;
  width:min(660px,100%);justify-self:center;min-width:0;min-height:0;
}
#gameMenu #socialPage .social-panel-tabs button {
  min-height:32px!important;height:32px!important;min-width:0!important;
  background:rgba(2,10,10,.32)!important;color:#fff;
  border:1px solid #9bafa5;font:800 13px/1 system-ui;
}
#gameMenu #socialPage .social-panel-tabs button[aria-selected="true"] { border-color:#e5d08d;background:rgba(202,173,86,.18)!important; }
#gameMenu #socialPage .account-layout {
  grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;
  height:100%!important;min-height:0!important;overflow:hidden!important;
}
#gameMenu #socialPage .account-card {
  width:100%!important;min-height:0!important;height:100%!important;
  max-width:1100px!important;justify-self:center!important;align-content:center!important;
}
#gameMenu #socialPage .account-card[hidden],#gameMenu .social-list-row[hidden],
#gameMenu .social-list-pagination[hidden],#gameMenu #guildPanel[hidden],
#gameMenu #guildOfficerTools[hidden],#gameMenu #guildMessage[hidden],
#gameMenu .social-list-actions[hidden],#gameMenu .guild-panel-tabs [hidden] { display:none!important; }
#gameMenu #socialPage .account-card--social {
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px 18px!important;
}
#gameMenu #socialPage .account-card--social .account-state { grid-row:1;grid-column:1/-1; }
#gameMenu #socialPage .account-card--social .account-action-row { grid-column:2;grid-row:2;align-self:end; }
#gameMenu #socialPage .social-guild-card {
  box-sizing:border-box!important;display:grid!important;
  grid-template-rows:minmax(0,1fr) auto!important;gap:4px!important;align-content:stretch!important;
  padding:5px 7px!important;
}
#gameMenu #socialPage .social-guild-card > .account-state { display:none!important; }
#gameMenu #socialPage .social-guild-card:has(#guildPanel[hidden]) { align-content:center!important;grid-template-rows:auto auto auto!important; }
#gameMenu #socialPage .social-guild-card:has(#guildPanel[hidden]) > .account-state { display:grid!important; }
#gameMenu #guildPanel:not([hidden]) {
  min-height:0;min-width:0;height:100%;display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);
  grid-template-rows:22px 30px minmax(0,1fr) 28px;
  gap:4px 12px;overflow:hidden;
}
#gameMenu #guildPanel .guild-base-header { grid-column:1;grid-row:1;min-width:0;gap:8px; }
#gameMenu #guildPanel .guild-base-header strong { font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
#gameMenu #guildPanel .guild-base-header small { font-size:10px; }
#gameMenu #guildPanel .guild-panel-tabs { grid-column:1;grid-row:2;display:flex;gap:5px;min-width:0; }
#gameMenu #guildPanel .guild-panel-tabs button { flex:1;min-width:0;min-height:28px!important;height:28px!important;margin:0!important;padding:3px 5px!important;font-size:11px!important; }
#gameMenu #guildPanel .guild-panel-tabs button[aria-selected="true"] { border-color:#e5d08d;background:rgba(202,173,86,.18)!important; }
#gameMenu #guildPanel :is(#guildMessage,#guildOfficerTools) { grid-column:1;grid-row:3/-1;min-width:0;min-height:0; }
#gameMenu #guildMessage { margin:0;padding:6px;font-size:12px;line-height:1.3;overflow-wrap:anywhere; }
#gameMenu #guildOfficerTools:not([hidden]) { display:grid;grid-template-rows:repeat(2,minmax(0,1fr));gap:5px;align-content:start; }
#gameMenu #guildOfficerTools .social-inline-form { display:flex!important;flex-wrap:nowrap!important;min-width:0;min-height:0;gap:6px; }
#gameMenu #guildOfficerTools input { min-width:0!important;min-height:30px!important;height:30px!important;flex-basis:0!important;flex:1!important;margin:0!important; }
#gameMenu #guildOfficerTools button { min-height:30px!important;height:30px!important;padding:3px 8px!important; }
#gameMenu #guildMemberList {
  grid-column:2;grid-row:1/4;min-width:0!important;min-height:0!important;max-height:none!important;
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(var(--social-list-rows,3),minmax(0,1fr));
  gap:4px!important;overflow:hidden!important;
}
#gameMenu #guildMemberList + .social-list-pagination { grid-column:2;grid-row:4; }
#gameMenu .social-list-pagination {
  min-width:0;min-height:0;height:28px;display:grid;
  grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;gap:5px;
  width:min(280px,100%);margin:0 auto;
}
#gameMenu .social-list-pagination button { height:28px!important;min-height:28px!important;padding:0!important;font-size:22px!important; }
#gameMenu .social-list-pagination span { font:800 11px/1 system-ui;text-align:center; }
#gameMenu :is(#guildMemberList,#guildInviteList,#friendIncomingList,#friendOutgoingList) .social-list-row {
  position:relative;box-sizing:border-box;min-width:0;min-height:0;
  padding:0!important;overflow:hidden;background:rgba(2,10,10,.34)!important;
}
#gameMenu :is(#guildMemberList,#guildInviteList,#friendIncomingList,#friendOutgoingList) .social-list-person {
  box-sizing:border-box;width:100%;height:100%;min-height:0!important;
  display:flex;align-items:center;gap:6px;padding:3px 6px!important;overflow:hidden;
}
#gameMenu :is(#guildMemberList,#guildInviteList,#friendIncomingList,#friendOutgoingList) .social-list-person strong { font-size:12px;line-height:14px; }
#gameMenu :is(#guildMemberList,#guildInviteList,#friendIncomingList,#friendOutgoingList) .social-list-person small { font-size:10px;line-height:11px; }
#gameMenu :is(#guildMemberList,#guildInviteList,#friendIncomingList,#friendOutgoingList) .social-list-actions:not([hidden]) {
  position:absolute;inset:0;display:flex!important;gap:3px;padding:3px;
  background:rgba(2,10,10,.98)!important;z-index:2;
}
#gameMenu :is(#guildMemberList,#guildInviteList,#friendIncomingList,#friendOutgoingList) .social-list-actions button { flex:1;min-width:0!important;min-height:0!important;height:100%!important;padding:3px!important;font-size:10px!important; }
#gameMenu #guildInviteList { max-height:none!important;min-height:0!important;overflow:hidden!important;grid-template-rows:repeat(var(--social-list-rows,2),minmax(0,1fr)); }
#gameMenu #friendsPage .friends-name-grid {
  grid-template-rows:repeat(var(--social-list-rows,4),minmax(0,1fr))!important;
  min-height:0!important;max-height:100%!important;
}
#gameMenu #friendIncomingList,#gameMenu #friendOutgoingList {
  min-height:0!important;max-height:none!important;overflow:hidden!important;
  display:grid!important;grid-template-rows:repeat(var(--social-list-rows,2),minmax(0,1fr));gap:4px!important;
}
@media (orientation:landscape) and (max-height:420px) {
  #gameMenu #socialPage:not([hidden]) { grid-template-rows:20px 30px minmax(0,1fr)!important;gap:4px!important; }
  #gameMenu #socialPage > h2 { font-size:17px!important;line-height:20px!important; }
  #gameMenu #socialPage .social-panel-tabs button { height:30px!important;min-height:30px!important; }
  #gameMenu #guildPanel:not([hidden]) { grid-template-rows:18px 28px minmax(0,1fr) 28px;gap:3px 8px; }
  #gameMenu #guildPanel .guild-base-header strong { font-size:13px; }
  #gameMenu #guildMessage { padding:4px;font-size:11px;line-height:1.2; }
  #gameMenu #guildOfficerTools :is(input,button) { height:28px!important;min-height:28px!important;font-size:11px!important; }
  #gameMenu #guildPanel .guild-panel-tabs button { min-height:26px!important;height:26px!important;font-size:10px!important; }
  #gameMenu #guildMemberList .social-list-person strong { font-size:11px;line-height:12px; }
  #gameMenu #guildMemberList .social-list-person small { font-size:9px;line-height:10px; }
  #gameMenu #guildMemberList .social-list-actions button { font-size:9px!important; }
}

/* Requests use a side column, so their own pagination never steals rows from
   the friends grid or introduces a second scrolling surface. */
#gameMenu.friends-menu-open #friendsPage .friends-page-content {
  height:100%!important;grid-template-columns:minmax(160px,.45fr) minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr)!important;gap:10px!important;
}
#gameMenu.friends-menu-open #friendsPage .friends-page-content:has(.friends-section--requests .social-list-empty) { grid-template-columns:minmax(0,1fr)!important; }
#gameMenu.friends-menu-open #friendsPage .friends-section--requests {
  box-sizing:border-box!important;display:grid!important;min-height:0!important;max-height:none!important;height:100%!important;
  grid-template-rows:22px minmax(0,1fr) 28px!important;gap:5px!important;margin:0!important;overflow:hidden!important;
}
#gameMenu.friends-menu-open #friendsPage .friends-section--requests:has(.social-list-empty) { display:none!important; }
#gameMenu.friends-menu-open #friendsPage .friends-section--requests h3 { position:static!important;min-height:0!important;margin:0!important;padding:0!important;line-height:22px!important;font-size:12px!important;background:transparent!important; }
#gameMenu #friendsPage #friendIncomingList { height:100%!important;grid-template-columns:minmax(0,1fr)!important; }
#gameMenu.friends-menu-open #friendsPage .friends-section--list {
  grid-template-rows:22px minmax(0,1fr) 28px!important;gap:5px!important;
}
#gameMenu #friendsPage .friends-section-heading { grid-row:1!important;min-height:0!important;height:22px!important; }
#gameMenu #friendsPage .friends-name-grid { grid-row:2!important;height:100%!important; }
#gameMenu #friendsPage .friends-name-grid + .social-list-pagination { grid-row:3!important; }
#gameMenu #friendsPage .friends-empty-state { grid-row:2!important;margin:0!important;align-self:center!important; }
#gameMenu #friendsPage .friends-add-dialog {
  box-sizing:border-box!important;width:min(620px,100%)!important;height:min(330px,100%)!important;max-height:100%!important;
  min-height:0!important;grid-template-rows:24px 34px minmax(0,1fr) 28px!important;gap:7px!important;padding:18px 24px!important;
  overflow:hidden!important;
}
#gameMenu #friendsPage .friends-add-dialog h3 { font-size:18px!important;line-height:24px!important; }
#gameMenu #friendsPage .friends-add-form :is(input,button) { box-sizing:border-box!important;min-height:32px!important;height:32px!important;padding:3px 8px!important;font-size:12px!important; }
#gameMenu #friendsPage #friendOutgoingList { height:100%!important; }
#gameMenu #friendsPage .friends-dialog-close { height:30px!important;min-height:30px!important;width:30px!important;min-width:30px!important; }
@media (orientation:landscape) and (max-height:420px) {
  #gameMenu.friends-menu-open #friendsPage .friends-page-content { grid-template-columns:minmax(145px,.45fr) minmax(0,1fr)!important;gap:7px!important; }
  #gameMenu #friendsPage .friends-section--requests h3 { font-size:11px!important; }
  #gameMenu #friendsPage .friends-add-dialog { padding:12px 18px!important;gap:5px!important; }
  #gameMenu #friendsPage .friends-detail-actions { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
}

/* Legacy upgrade/refining tools are still reachable from the new workshop. */
#gameMenu.blacksmith-menu-open { box-sizing:border-box!important;padding:5px!important;overflow:hidden!important;background:rgba(2,9,8,.57)!important; }
#gameMenu.blacksmith-menu-open > .game-menu-window {
  box-sizing:border-box!important;display:grid!important;grid-template-rows:minmax(0,1fr)!important;
  width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;
  max-width:1280px!important;padding:3px 40px 3px 3px!important;overflow:hidden!important;background:transparent!important;
}
#gameMenu.blacksmith-menu-open .legacy-menu-tabs { display:none!important; }
#gameMenu.blacksmith-menu-open > .game-menu-window > #blacksmithPage:not([hidden]) {
  box-sizing:border-box!important;display:grid!important;grid-template-rows:42px 36px minmax(0,1fr)!important;
  grid-column:1!important;grid-row:1!important;
  min-width:0!important;min-height:0!important;height:100%!important;max-height:100%!important;
  width:100%!important;padding:0!important;gap:6px!important;overflow:hidden!important;background:transparent!important;
}
#gameMenu #blacksmithPage .blacksmith-header { box-sizing:border-box!important;min-height:0!important;display:flex!important;align-items:center!important;padding:0!important;gap:8px!important; }
#gameMenu #blacksmithPage .blacksmith-header > div { min-width:0!important; }
#gameMenu #blacksmithPage .blacksmith-header > div:first-child { flex:1!important; }
#gameMenu #blacksmithPage .blacksmith-header > .blacksmith-craft-button { min-height:28px!important;height:28px!important;padding:3px 8px!important;font-size:12px!important; }
#gameMenu #blacksmithPage .blacksmith-header :is(small,p) { display:none!important; }
#gameMenu #blacksmithPage .blacksmith-header h2 { font-size:20px!important;margin:0!important;line-height:24px!important; }
#gameMenu #blacksmithPage .blacksmith-wallet { min-width:0!important;min-height:0!important;padding:3px 7px!important;gap:2px!important; }
#gameMenu #blacksmithPage .blacksmith-wallet strong { font-size:13px!important; }
#gameMenu #blacksmithPage .blacksmith-wallet span { font-size:10px!important; }
#gameMenu #blacksmithPage .blacksmith-page-tabs { display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;padding:0!important;margin:0!important;gap:6px!important; }
#gameMenu #blacksmithPage .blacksmith-page-tabs button { min-height:34px!important;height:34px!important;padding:3px 7px!important;font-size:13px!important; }
#gameMenu #blacksmithPage .blacksmith-layout { min-height:0!important;height:100%!important;padding:0!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;overflow:hidden!important; }
#gameMenu #blacksmithPage .blacksmith-view:not([hidden]) { box-sizing:border-box!important;min-width:0!important;min-height:0!important;height:100%!important;max-height:100%!important;padding:0!important;overflow:hidden!important;background:transparent!important; }
#gameMenu #blacksmithPage .blacksmith-view[hidden],#gameMenu #blacksmithPage [hidden],
#gameMenu #blacksmithPage .blacksmith-list-pagination[hidden] { display:none!important; }
#gameMenu #blacksmithPage .blacksmith-section-heading,#gameMenu #blacksmithPage .blacksmith-rule { display:none!important; }
#gameMenu #blacksmithPage .blacksmith-upgrade-panel { display:grid!important;grid-template-rows:minmax(0,1fr)!important; }
#gameMenu #blacksmithPage .blacksmith-forge-accordion { display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:32px minmax(0,1fr)!important;gap:5px 10px!important;min-height:0!important;height:100%!important;overflow:hidden!important; }
#gameMenu #blacksmithPage .blacksmith-forge-accordion > .responsive-accordion-item { display:contents!important;overflow:visible!important; }
#gameMenu #blacksmithPage .blacksmith-forge-accordion .responsive-accordion-trigger { box-sizing:border-box!important;grid-row:1!important;min-height:32px!important;height:32px!important;padding:3px 7px!important;font-size:13px!important; }
#gameMenu #blacksmithPage .blacksmith-forge-accordion > .responsive-accordion-item:first-child .responsive-accordion-trigger { grid-column:1!important; }
#gameMenu #blacksmithPage .blacksmith-forge-accordion > .responsive-accordion-item:last-child .responsive-accordion-trigger { grid-column:2!important; }
#gameMenu #blacksmithWeaponsAccordionPanel:not([hidden]) { grid-column:1!important;grid-row:2!important;display:grid!important;grid-template-rows:minmax(0,1fr) 30px!important;min-height:0!important;height:100%!important;padding:0!important;gap:5px!important;overflow:hidden!important; }
#gameMenu #blacksmithSelectionAccordionPanel:not([hidden]) { grid-column:2!important;grid-row:2!important;display:grid!important;grid-template-rows:minmax(0,1fr)!important;min-height:0!important;height:100%!important;padding:0!important;overflow:hidden!important; }
#gameMenu #blacksmithPage :is(#blacksmithEquipmentGrid,#blacksmithRecipeGrid,#blacksmithMaterialSellGrid) {
  display:grid!important;grid-template-columns:repeat(var(--blacksmith-list-columns,3),minmax(0,1fr))!important;
  grid-template-rows:repeat(var(--blacksmith-list-rows,2),minmax(0,1fr))!important;
  box-sizing:border-box!important;min-height:0!important;height:100%!important;max-height:100%!important;
  min-width:0!important;padding:0!important;gap:6px!important;overflow:hidden!important;
}
#gameMenu #blacksmithEquipmentGrid .blacksmith-equipment-card { box-sizing:border-box!important;min-height:0!important;height:100%!important;grid-template-columns:32px minmax(0,1fr) auto!important;padding:4px!important;gap:5px!important;background:rgba(2,10,10,.34)!important; }
#gameMenu #blacksmithEquipmentGrid .blacksmith-equipment-card .item-icon { width:30px!important;height:30px!important; }
#gameMenu #blacksmithEquipmentGrid .blacksmith-equipment-card b { font-size:12px!important;line-height:14px!important; }
#gameMenu #blacksmithEquipmentGrid .blacksmith-equipment-card :is(small,em) { font-size:10px!important;line-height:11px!important; }
#gameMenu #blacksmithPage .blacksmith-list-pagination { display:grid!important;grid-template-columns:30px minmax(0,1fr) 30px!important;width:min(360px,100%)!important;justify-self:center!important;height:30px!important;min-height:0!important;gap:5px!important;align-items:center!important; }
#gameMenu #blacksmithPage .blacksmith-list-pagination button { min-height:28px!important;height:28px!important;font-size:23px!important;padding:0!important; }
#gameMenu #blacksmithPage .blacksmith-list-pagination span { font:800 12px/1 system-ui;text-align:center; }
#gameMenu #blacksmithPage .blacksmith-selection { box-sizing:border-box!important;display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;grid-template-rows:32px minmax(0,1fr) 34px!important;gap:5px 10px!important;min-height:0!important;height:100%!important;margin:0!important;padding:5px!important;background:rgba(2,10,10,.34)!important;overflow:hidden!important; }
#gameMenu #blacksmithSelectionBack { grid-column:1/-1!important;grid-row:1!important;justify-self:start!important;min-height:30px!important;height:30px!important;padding:3px 8px!important;font-size:12px!important; }
#gameMenu #blacksmithSelectedIcon { grid-column:1!important;grid-row:2!important;width:60px!important;height:60px!important;align-self:center!important; }
#gameMenu #blacksmithSelectedIcon .item-icon { width:56px!important;height:56px!important; }
#gameMenu #blacksmithPage .blacksmith-selected-copy { grid-column:2!important;grid-row:2!important;min-height:0!important;min-width:0!important;align-self:center!important;gap:4px!important; }
#gameMenu #blacksmithSelectedName { font-size:17px!important;line-height:19px!important; }
#gameMenu #blacksmithSelectedMeta { font-size:11px!important;line-height:12px!important; }
#gameMenu #blacksmithRequirement { font-size:11px!important;line-height:13px!important;margin:0!important; }
#gameMenu #blacksmithPowerPreview { min-width:0!important;min-height:0!important;gap:5px!important; }
#gameMenu #blacksmithPowerPreview > div { padding:4px 6px!important; }
#gameMenu #blacksmithPowerPreview :is(small,span) { font-size:10px!important;line-height:11px!important; }
#gameMenu #blacksmithPowerPreview strong { font-size:13px!important;line-height:15px!important; }
#gameMenu #blacksmithUpgradeButton { grid-column:1/-1!important;grid-row:3!important;min-height:32px!important;height:32px!important;padding:3px 8px!important;font-size:13px!important; }
#gameMenu #blacksmithPage .blacksmith-refinery-panel:not([hidden]) { display:grid!important;grid-template-rows:32px minmax(0,1fr) 30px!important;gap:5px!important; }
#gameMenu #blacksmithPage .blacksmith-refinery-note { display:none!important; }
#gameMenu #blacksmithBandTabs { display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;min-height:0!important;height:32px!important;gap:5px!important;overflow:hidden!important; }
#gameMenu #blacksmithBandTabs button { min-width:0!important;min-height:30px!important;height:30px!important;padding:3px 5px!important;font-size:11px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-recipe-card { box-sizing:border-box!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) 30px!important;min-height:0!important;height:100%!important;padding:5px!important;gap:4px!important;background:rgba(2,10,10,.34)!important;overflow:hidden!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-recipe-card header { gap:5px!important;min-height:0!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-recipe-card header .item-icon { width:28px!important;height:28px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-recipe-card header strong { font-size:12px!important;line-height:13px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-recipe-card header :is(small,em) { font-size:10px!important;line-height:11px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-ingredients { min-height:0!important;gap:4px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-ingredients > span { min-height:0!important;padding:3px 5px!important;gap:2px 5px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-ingredients .item-icon { width:20px!important;height:20px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-ingredients b { font-size:11px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-ingredients small { font-size:10px!important;line-height:11px!important; }
#gameMenu #blacksmithRecipeGrid .blacksmith-craft-button { min-height:28px!important;height:28px!important;padding:3px 6px!important;font-size:11px!important; }
#gameMenu #blacksmithPage :is(#blacksmithEquipmentGrid,#blacksmithRecipeGrid,#blacksmithMaterialSellGrid) > [hidden] { display:none!important; }
#gameMenu #blacksmithPage .blacksmith-commerce-panel:not([hidden]) { display:grid!important;grid-template-rows:minmax(0,1fr) 30px!important;gap:5px!important; }
#gameMenu #blacksmithMaterialSellGrid > article { box-sizing:border-box!important;min-height:0!important;height:100%!important;display:grid!important;grid-template-columns:24px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) 28px!important;gap:3px 5px!important;padding:4px!important;overflow:hidden!important;background:rgba(2,10,10,.34)!important; }
#gameMenu #blacksmithMaterialSellGrid .item-icon { width:22px!important;height:22px!important; }
#gameMenu #blacksmithMaterialSellGrid article span b { font-size:12px!important;line-height:13px!important; }
#gameMenu #blacksmithMaterialSellGrid article span small { font-size:10px!important;line-height:11px!important; }
#gameMenu #blacksmithMaterialSellGrid article > strong { grid-row:2!important;grid-column:1!important;font-size:11px!important;align-self:center; }
#gameMenu #blacksmithMaterialSellGrid article button { grid-row:2!important;grid-column:2!important;min-height:26px!important;height:26px!important;padding:2px 5px!important;font-size:11px!important; }
@media (pointer:coarse),(hover:none),(max-width:900px),(orientation:landscape) and (max-height:760px) {
  #gameMenu #blacksmithWeaponsAccordionPanel:not([hidden]),#gameMenu #blacksmithSelectionAccordionPanel:not([hidden]) { grid-column:1/-1!important; }
}
@media (orientation:landscape) and (max-height:420px) {
  #gameMenu.blacksmith-menu-open > .game-menu-window > #blacksmithPage:not([hidden]) { grid-template-rows:32px 32px minmax(0,1fr)!important;gap:4px!important; }
  #gameMenu #blacksmithPage .blacksmith-header h2 { font-size:17px!important;line-height:20px!important; }
  #gameMenu #blacksmithPage .blacksmith-page-tabs button { height:30px!important;min-height:30px!important;font-size:12px!important; }
  #gameMenu #blacksmithPage .blacksmith-selection { grid-template-columns:44px minmax(0,1fr)!important;grid-template-rows:28px minmax(0,1fr) 30px!important;padding:3px!important; }
  #gameMenu #blacksmithSelectedIcon { width:42px!important;height:42px!important; }
  #gameMenu #blacksmithSelectedIcon .item-icon { width:40px!important;height:40px!important; }
  #gameMenu #blacksmithSelectedName { font-size:15px!important;line-height:17px!important; }
  #gameMenu #blacksmithUpgradeButton { height:28px!important;min-height:28px!important;font-size:12px!important; }
  #gameMenu #blacksmithPowerPreview > div > span { display:none!important; }
}

/* Allocation uses the remaining landscape height, including its bottom actions. */
@media (orientation:landscape) and (max-height:700px) {
  #gameMenu.standard-menu-open #attributesPage:not([hidden]) {
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:28px minmax(0,1fr)!important;gap:5px!important;
    min-height:0!important;height:100%!important;max-height:100%!important;
    overflow:hidden!important;
  }
  #gameMenu #attributesPage > .attribute-page-heading {
    grid-column:1!important;grid-row:1!important;height:28px!important;
    min-height:28px!important;max-height:28px!important;margin:0!important;
  }
  #gameMenu #attributesPage > .attribute-subpage:not([hidden]) {
    grid-column:1!important;grid-row:2!important;min-height:0!important;
    height:100%!important;max-height:100%!important;padding:0!important;margin:0!important;
  }
  #gameMenu #attributesPage #attributesDistributionView:not([hidden]) {
    box-sizing:border-box!important;display:grid!important;grid-template-rows:minmax(0,1fr)!important;
    min-height:0!important;height:100%!important;max-height:100%!important;overflow:hidden!important;
  }
  #gameMenu #attributesPage .attribute-panel--qol {
    position:relative!important;box-sizing:border-box!important;min-height:0!important;
    height:100%!important;max-height:100%!important;padding:0!important;
    grid-template-rows:28px repeat(3,minmax(0,1fr)) 36px!important;
    gap:4px 10px!important;overflow:hidden!important;
  }
  #gameMenu #attributesPage .attribute-points-heading {
    position:static!important;display:flex!important;align-items:center!important;
    min-height:0!important;height:28px!important;max-height:28px!important;
    grid-template-rows:none!important;padding:0!important;margin:0!important;
  }
  #gameMenu #attributesPage .attribute-row {
    box-sizing:border-box!important;min-height:0!important;height:100%!important;
    max-height:100%!important;padding:2px 6px!important;
  }
  #gameMenu #attributesPage .attribute-row .attribute-add-button {
    min-height:28px!important;height:28px!important;max-height:28px!important;
    min-width:30px!important;width:30px!important;padding:0!important;
  }
  #gameMenu #attributesPage .attribute-allocation-control {
    position:absolute!important;bottom:0!important;left:50%!important;
    width:auto!important;margin:0!important;transform:translateX(-50%)!important;
  }
  #gameMenu #attributesPage .attribute-allocation-control :is(button,input) {
    box-sizing:border-box!important;min-height:32px!important;height:32px!important;
    max-height:32px!important;padding:0!important;margin:0!important;
  }
  #gameMenu #attributesPage .attribute-reset-button {
    position:absolute!important;top:auto!important;bottom:0!important;left:0!important;
    min-height:32px!important;height:32px!important;max-height:32px!important;
    margin:0!important;
  }
}
