/* Item previews keep one complete card inside their allotted space. */
.lot-fan-card .mini-real.slot-choice{width:172px!important;height:220px!important;min-height:0!important;transform-origin:0 0;pointer-events:none}
.lot-fan-card .mini-real.slot-choice .relic-card{width:172px!important;height:220px!important;min-height:0!important;background:var(--item-wash)!important;border-color:var(--item-edge)!important;overflow:hidden}
.mini-real.slot-choice .relic-turn,.mini-real.slot-choice .relic-face{height:100%!important;min-height:0!important;box-sizing:border-box}
.mini-real.slot-choice .inventory-card{display:flex!important;flex-direction:column!important;width:100%!important;height:220px!important;min-height:0!important;box-sizing:border-box;padding:10px!important;gap:0!important}
.mini-real.slot-choice .inventory-topline{flex:none;font-size:calc(9px)!important}
.mini-real.slot-choice .inventory-art{flex:none;height:74px!important;margin:4px 0!important}
.mini-real.slot-choice .inventory-art img{height:74px!important;max-height:74px!important}
.mini-real.slot-choice .inventory-title{flex:none;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;overflow:hidden!important;min-height:32px!important;height:32px!important;margin:2px 0 6px!important;font:700 calc(13px)/1.2 Interface,sans-serif!important}
.mini-real.slot-choice .inventory-title>span{white-space:normal!important;animation:none!important;transform:none!important}
.mini-real.slot-choice .inventory-properties{flex:none!important;min-height:25px!important}
.mini-real.slot-choice .inventory-footer{margin-top:auto!important;font-size:calc(8px)!important}
.mini-real.slot-choice .item-stat-chip{font-size:calc(10px)!important}
.mini-real.slot-choice .inventory-condition{flex:none}

#modal-root .trade-exchange-sheet .xc{flex:1 1 auto!important;min-height:100%!important;gap:8px}
#modal-root .trade-exchange-sheet .xc-side{flex:1 0 auto!important;min-height:190px!important;min-width:0;box-sizing:border-box;overflow:hidden}
#modal-root .trade-exchange-sheet .xc-side .xc-fan{flex:1 0 145px!important;min-height:145px!important;height:auto!important;overflow:hidden!important;position:relative}
#modal-root .trade-exchange-sheet .xc-fan .lot-fan-card:has(.mini-real){width:112px!important;height:144px!important}
#modal-root .trade-exchange-sheet .xc-side header{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
#modal-root .trade-exchange-sheet .xc-side header h4{min-width:0;margin:0}
#modal-root .trade-exchange-sheet .xc-interest{flex:none;display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;min-width:0;min-height:76px;height:auto;margin:0;padding:7px 9px;box-sizing:border-box;overflow:hidden}
#modal-root .trade-exchange-sheet .xc-interest-anim{height:60px}
#modal-root .trade-exchange-sheet .xc-interest-copy{min-width:0;overflow-wrap:anywhere}
#modal-root .trade-exchange-sheet .xc-interest-copy>small{font:600 calc(11px)/1.35 Interface,sans-serif}
#modal-root .trade-exchange-sheet .xc-foot{position:sticky;bottom:0;background:#fbf6ea;z-index:5;padding:5px 0 2px!important}
#modal-root .trade-exchange-sheet .xc-status{min-height:0!important;padding:0 3px;font-size:calc(11px)!important}

/* A scrollable grid must not shrink every row into the sheet's available height. */
#modal-root .slot-sheet>.item-grid.slot-choice,#modal-root .xc-sheet-grid.is-bag{align-content:start!important;align-items:start!important;grid-auto-rows:max-content!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#modal-root .slot-sheet>.slot-choice>.relic-card,#modal-root .xc-sheet-grid.is-bag .xc-pick-card{height:calc(258px + max(0px,(var(--valgard-text-scale,1) - 1) * 90px))!important;min-height:258px!important;max-height:none!important;aspect-ratio:auto!important;min-width:0}
#modal-root .slot-sheet>.slot-choice>.relic-card>.relic-turn,#modal-root .slot-sheet>.slot-choice>.relic-card .relic-face{height:100%!important;min-height:0!important}

.city-modal .city-product{align-items:start}
.city-modal .city-product-copy{align-self:start;padding-top:2px}
.city-modal .city-product-copy>strong{margin:3px 0 6px!important}
.city-modal .city-product-facts{align-items:center;min-height:24px}
.city-modal .city-product-facts .item-stat-chip{display:inline-flex;align-items:center;gap:5px;margin:0;line-height:1.2}
.city-modal .city-product-facts img,.city-modal .city-product-facts .icon{width:calc(18px)!important;height:calc(18px)!important;object-fit:contain}
.city-modal .city-privilege-list:has(.is-mem),.city-modal .city-privilege-list:has(.is-skin){cursor:grab}
.city-modal .city-privilege-list.is-dragging{cursor:grabbing;user-select:none}
.city-modal .city-offer{min-width:0!important;box-sizing:border-box}
.city-modal .city-offer.is-mem,.city-modal .city-offer.is-skin{flex:0 0 82%!important;max-width:82%}
.city-modal .city-offer>div{min-width:0;max-width:100%}
.city-modal .city-offer strong,.city-modal .city-offer p{max-width:100%;overflow-wrap:anywhere}
.city-modal .city-offer.is-mem>div{width:100%;box-sizing:border-box}
.city-modal .city-offer-items{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;width:100%;box-sizing:border-box}
.city-modal .city-offer-items button{width:100%!important;min-width:0!important;padding:4px 2px!important;box-sizing:border-box}
.city-modal .city-offer-items small{width:100%;font-size:calc(8px);line-height:1.15;overflow-wrap:anywhere}
.city-modal .city-offer.is-mem .city-mem-art{flex:none;min-width:0;box-sizing:border-box}
.city-modal .city-offer img{-webkit-user-drag:none}

/* Keep the existing close artwork, centered inside its button. */
:is(#modal-root,.vg-sheet-shade,#presence-panel) button:is([data-close],[data-vg-close],[data-presence-close],.friends-close,.vg-close){display:inline-grid!important;place-items:center!important;align-content:center!important;justify-content:center!important;padding:0!important;line-height:1!important;box-sizing:border-box;flex-shrink:0}
:is(#modal-root,.vg-sheet-shade,#presence-panel) button:is([data-close],[data-vg-close],[data-presence-close],.friends-close,.vg-close)>:is(.icon,img,svg){display:block;margin:0!important;line-height:1!important;align-self:center;justify-self:center}

button[aria-label^="Закрыть"],button[data-effect-note-close]{display:inline-grid!important;place-items:center!important;align-content:center!important;justify-content:center!important;padding:0!important;line-height:1!important;box-sizing:border-box}
button[aria-label^="Закрыть"]>:is(.icon,img,svg){display:block;margin:0!important;line-height:1!important;align-self:center;justify-self:center}

#modal-root .trade-exchange-sheet .xc-side header h4{font:700 calc(14px)/1.25 Interface,sans-serif!important;white-space:normal!important;overflow-wrap:anywhere}
#modal-root .trade-exchange-sheet .xc-side header .xc-ok{font:600 calc(10.5px)/1.2 Interface,sans-serif!important}

/* Full-width choices keep names and properties readable on a phone. */
#modal-root .slot-sheet>.item-grid.slot-choice,#modal-root .xc-sheet-grid.is-bag{grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
#modal-root .slot-sheet>.slot-choice>.relic-card,#modal-root .xc-sheet-grid.is-bag .xc-pick-card{height:172px!important;min-height:172px!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .relic-card>.relic-turn,#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .relic-face{height:100%!important;min-height:0!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-card{display:grid!important;grid-template-columns:76px minmax(0,1fr)!important;grid-template-rows:18px minmax(36px,auto) 27px 23px 3px!important;column-gap:12px!important;row-gap:4px!important;padding:10px!important;height:172px!important;min-height:0!important;box-sizing:border-box}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-topline{grid-column:1/-1;grid-row:1;display:flex;justify-content:space-between;align-items:center;font-size:calc(10px)!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-art{grid-column:1;grid-row:2/5;height:108px!important;width:76px;margin:0!important;align-self:center}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-art img{width:76px!important;max-width:76px!important;height:100%!important;max-height:100px!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) h3.inventory-title{grid-column:2;grid-row:2;align-self:center;margin:0!important;min-height:0!important;height:auto!important;max-height:2.6em!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden!important;white-space:normal!important;font:700 calc(14px)/1.25 Interface,sans-serif!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) h3.inventory-title>span{white-space:normal!important;animation:none!important;transform:none!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-properties{grid-column:2;grid-row:3;align-self:center;margin:0!important;height:25px!important;min-height:0!important}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-footer{grid-column:2;grid-row:4;margin:0!important;padding-top:4px!important;min-width:0;font-size:calc(9px)!important;align-self:end}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .inventory-condition{grid-column:2;grid-row:5;margin:0!important;width:100%}
#modal-root :is(.slot-sheet,.xc-sheet-grid.is-bag) .relic-back{padding:10px 12px;overflow-y:auto;gap:4px}
.city-modal .city-product .city-product-facts .item-stat-chip{padding:0!important;margin:0!important;align-items:center;gap:6px!important}
.city-modal .city-product>footer{align-items:center!important}
.city-modal .city-product>footer .city-price{display:inline-flex;align-items:center;align-self:center;line-height:1;gap:5px;margin:0!important}
.city-modal .city-product>footer .city-price>img{display:block;width:calc(24px);height:calc(24px);object-fit:contain}

/* Exchange cards use their displayed dimensions. Scaling/rotating the whole 3D
   card down blurred the text on Android; the full viewer still flips normally. */
#modal-root .xc-fan .lot-fan-card:has(.mini-real.is-sharp){transform:translate(-50%,-50%) translateX(calc((var(--i) - (var(--n) - 1) / 2) * min(118px,calc((100vw - 170px) / max(var(--n) - 1,1)))))!important}
.lot-fan-card .mini-real.is-sharp,.lot-fan-card .mini-real.is-sharp .relic-card{width:100%!important;height:100%!important;transform:none!important;perspective:none!important;transform-style:flat!important;will-change:auto!important}
.mini-real.is-sharp .relic-turn,.mini-real.is-sharp .relic-front{transform:none!important;transform-style:flat!important;perspective:none!important;animation:none!important;transition:none!important;will-change:auto!important}
.mini-real.is-sharp .relic-front{padding:0!important;display:block!important}
.mini-real.is-sharp .relic-back,.mini-real.is-sharp .relic-edge{display:none!important}
.mini-real.is-sharp .inventory-card{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:13px minmax(0,1fr) 27px 18px 11px 2px!important;gap:2px!important;align-content:stretch;height:100%!important;padding:7px!important}
.mini-real.is-sharp .inventory-topline{grid-row:1;font-size:calc(8px)!important;line-height:1.2;min-height:0!important;height:13px!important}
.mini-real.is-sharp .inventory-topline small{font-size:calc(8px)!important;line-height:1!important;padding:1px 4px!important;min-height:0!important;height:auto!important}
.mini-real.is-sharp .inventory-topline>*{font-size:calc(8px)!important;line-height:1.1!important;min-height:0!important;padding-block:1px!important}
.mini-real.is-sharp .inventory-art{grid-row:2;height:44px!important;min-height:0!important;max-height:100%!important;margin:0!important;overflow:hidden;align-self:center}
.mini-real.is-sharp .inventory-art img{width:100%!important;height:44px!important;max-width:100%!important;max-height:44px!important;object-fit:contain;transform:none!important}
.mini-real.is-sharp h3.inventory-title{grid-row:3;font:700 calc(11px)/1.2 Interface,sans-serif!important;height:27px!important;min-height:27px!important;margin:0!important;letter-spacing:0!important}
.mini-real.is-sharp .inventory-properties{grid-row:4;height:18px!important;min-height:18px!important;margin:0!important}
.mini-real.is-sharp .item-stat-chip{font-size:calc(9px)!important;line-height:1.2!important;min-width:0!important;min-height:16px!important;height:16px!important;box-sizing:border-box;padding:1px 3px!important;gap:3px!important}
.mini-real.is-sharp .item-stat-chip b{font-size:inherit!important}
.mini-real.is-sharp .item-stat-chip img,.mini-real.is-sharp .item-stat-chip>.icon{width:calc(11px)!important;height:calc(11px)!important;font-size:calc(11px)!important}
.mini-real.is-sharp .inventory-footer{grid-row:5;font-size:calc(7.5px)!important;line-height:1.2;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden}
.mini-real.is-sharp .inventory-condition{grid-row:6;min-height:0!important;height:2px!important;margin:0!important}

/* The board shares the location panel's expand/collapse animation. Only its
   expanded list owns vertical scrolling; the compact three-page pager stays. */
#world.trade-board-expanded #destination{position:absolute!important;inset:0!important;height:auto!important;max-height:none!important;z-index:155;border-radius:16px;overflow:hidden}
#world.trade-board-expanded #destination>.location-inline-panel{inset:0!important;padding:12px!important;border-radius:16px!important}
#location-inline-panel .world-panel-body.has-trade-board{display:flex;flex-direction:column;overflow:hidden;min-height:0}
#location-inline-panel [data-trade-board-expand]{flex-shrink:0;touch-action:manipulation}
#location-inline-panel [data-trade-board-expand][aria-pressed=true]{background:#e7eddd;border-color:#96ae98}
.trade-inline.is-board.is-board-expanded{display:block;flex:1 1 auto;min-height:0;height:100%;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y!important;scrollbar-width:none;-ms-overflow-style:none;padding:2px 2px 14px;scroll-padding-block:8px;user-select:text;-webkit-user-select:text;overflow-anchor:none}
.trade-inline.is-board.is-board-expanded::-webkit-scrollbar{display:none;width:0;height:0}
.trade-inline.is-board.is-board-expanded *{touch-action:pan-y!important}
.is-board-expanded .board-offers{display:flex;flex-direction:column;gap:14px;min-width:0}
.trade-inline.is-board-expanded .board-offers>.trade-page{flex:none;min-height:0;height:auto;overflow:visible;padding:11px;gap:9px;border:1px solid #d9cdb5;border-radius:14px;background:linear-gradient(135deg,#fffdf4,#f7f0df);box-sizing:border-box;animation:none!important;transition:none}
.trade-inline.is-board-expanded .trade-page-stage{flex:none;height:190px;min-height:190px;max-height:none}
.trade-inline.is-board-expanded .trade-page-row{display:grid;gap:7px}
.trade-inline.is-board-expanded .trade-page-titlebox{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;margin:0}
.trade-inline.is-board-expanded .trade-page-row .trade-meta{flex-wrap:wrap}
.trade-inline.is-board-expanded .trade-page-note{flex:none;min-height:0;max-height:none;overflow:visible;margin:0;overflow-wrap:anywhere}
.trade-inline.is-board-expanded .trade-page-actions{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:7px;min-width:0}
.trade-inline.is-board-expanded .trade-page-actions .trade-page-ask{grid-column:1/-1;min-height:42px;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.2;padding:8px 10px}
.trade-inline.is-board-expanded .trade-page-actions .trade-inline-create{min-width:0;min-height:40px;padding:7px 10px}
.trade-inline.is-board-expanded .trade-page-actions .trade-chat-btn{width:42px;min-height:40px}
.trade-inline.is-board-expanded .board-more{display:block;width:100%;min-height:42px;margin-top:14px;white-space:normal;line-height:1.3}
@media(max-width:340px){.trade-inline.is-board-expanded .board-offers>.trade-page{padding:9px}.trade-inline.is-board-expanded .trade-page-stage{height:170px;min-height:170px}}
