/* Source Market2 icons/cards/buttons in a rebuilt, responsive screen-space frame.
 * The original fixed bitmap shell has paging protrusions; only its skyline is
 * used as a clipped header detail. No world-layer ordering changes. */
#build-drawer {
 width:min(790px,calc(100% - 40px));
 max-height:calc(100% - var(--drawer-bottom) - 85px);
 display:flex;flex-direction:column;overflow:hidden;padding:0;
 border:4px solid #fffbe7;border-radius:17px;background:#fff9e9;
 box-shadow:0 0 0 2px #2788ac,0 7px 18px #123b4b55;
}
#build-drawer .drawer-heading {
 position:relative;flex:none;min-height:42px;padding:5px 10px 5px 13px;
 border:0;background:#126b8e;
}
#build-drawer .panel-tabs {gap:6px;min-width:0}
#build-drawer .panel-tabs button {
 border:1px solid transparent;border-radius:13px;box-shadow:none;
 background:transparent;color:#d7f5ff;text-shadow:0 1px #15577c;
 font-size:13px;line-height:20px;padding:3px 14px;
}
#build-drawer .panel-tabs button.active {color:#fff;background:#318fac;border-color:#59a8bf}
#build-drawer #close-drawer {
 flex:none;width:28px;height:29px;padding:0;margin-left:8px;
 border:0;box-shadow:none;background:transparent url('./catalog-art/close-up.png') center/contain no-repeat;
 color:transparent;font-size:0;filter:none;
}
#build-drawer #close-drawer:hover {background-image:url('./catalog-art/close-over.png')}
#build-drawer #close-drawer:active {background-image:url('./catalog-art/close-down.png');transform:none}
#build-drawer #buildings-panel {
 display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden;padding:0;
}
#catalog-categories {
 position:relative;isolation:isolate;flex:none;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(64px,auto);align-items:stretch;gap:2px;min-height:138px;
 margin:0;padding:4px 16px 0;border-bottom:3px solid #fffbe7;
 background:#126b8e;
}
#catalog-categories::before {content:'';position:absolute;z-index:0;inset:0 0 auto;height:84px;background:url('./catalog-art/shell.png') center -44px/max(900px,120%) auto no-repeat;pointer-events:none}
#catalog-categories .catalog-category {
 position:relative;z-index:1;flex:1;min-width:0;max-width:none;
 display:flex;align-items:center;justify-content:flex-end;flex-direction:column;gap:2px;
 padding:2px 3px 8px;border:0;border-radius:10px 10px 0 0;box-shadow:none;
 background:transparent;filter:none;color:white;font-size:11px;line-height:14px;
}
#catalog-categories .catalog-category[aria-selected=true] {background:#fff9e9}
#catalog-categories .catalog-category:enabled:hover {background-color:#effaff24}
#catalog-categories .catalog-category[aria-selected=true]:hover {background-color:#fff9e9}
#catalog-categories .catalog-category:active {transform:none}
#catalog-categories .catalog-category:disabled {opacity:.48;cursor:default}
#catalog-categories .catalog-category-label {
 display:flex;align-items:center;justify-content:center;min-height:28px;
 text-align:center;color:#fff;text-shadow:0 1px #115979;
}
#catalog-categories .catalog-category[aria-selected=true] .catalog-category-label {color:#246d86;text-shadow:0 1px white}
.catalog-category-icon {flex:none;display:block;height:43px;width:52px;background-repeat:no-repeat;background-position:center;background-size:contain}
#build-drawer .build-heading {
 flex:none;min-height:50px;padding:6px 17px;margin:0;align-items:center;gap:12px;
 background:#fff9e9;border:0;border-bottom:1px solid #dfdfc9;border-radius:0;
}
#build-drawer #catalog-section-title {color:#257c99;font-size:18px;line-height:22px;text-shadow:0 1px white}
#build-drawer .intro {color:#857654;font-size:11px;line-height:15px;margin:1px 0 0}
#build-drawer #expand-land {flex:none;padding:4px 7px;border:1px solid #b8d7cf;border-radius:8px;background:#eef6df;box-shadow:inset 0 1px #fff;color:#347b8f;font-size:11px;line-height:16px;gap:4px}
#build-drawer #expand-land img {width:28px;height:28px;object-fit:contain}
#build-drawer #catalog {
 display:grid;grid-template-columns:repeat(3,minmax(0,220px));justify-content:center;
 grid-auto-rows:max-content;align-items:start;
 flex:0 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
 gap:14px 12px;padding:10px 17px;background:#fff9e9;
 scrollbar-width:thin;scrollbar-color:#64a3b5 #eee9d2;scroll-padding:10px;
}
#build-drawer #catalog[data-item-count="1"] {grid-template-columns:minmax(0,220px)}
#build-drawer #catalog[data-item-count="2"] {grid-template-columns:repeat(2,minmax(0,220px))}
#build-drawer #catalog[data-page-size="6"] {grid-template-columns:repeat(3,minmax(0,220px))}
@media(min-width:791px) and (min-height:760px) {
 #build-drawer #catalog[data-page-size="6"] {align-content:start;gap:8px 12px;padding:6px 17px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card {grid-template-rows:22px 76px 25px 13px;gap:2px;padding:0 2px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card-title {min-height:0;font-size:12px;line-height:14px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card-body {min-height:76px;border-width:10px 13px 12px;border-image-width:10px 13px 12px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card[data-lock-reason] .catalog-card-body {border-right-width:15px;border-image-width:10px 15px 12px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card-art {width:62px;height:60px}
 #build-drawer #catalog[data-page-size="6"] .catalog-item-icon {width:58px;height:56px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card-details {gap:2px}
 #build-drawer #catalog[data-page-size="6"] .catalog-stat {font-size:10px;line-height:12px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card-price {min-width:90px;min-height:24px;padding:1px 7px;font-size:12px;line-height:18px}
 #build-drawer #catalog[data-page-size="6"] .catalog-currency-icon {width:15px;height:15px}
 #build-drawer #catalog[data-page-size="6"] .catalog-currency-label {font-size:10px}
 #build-drawer #catalog[data-page-size="6"] .catalog-card-requirement {min-height:13px;font-size:10px;line-height:13px}
}
#build-drawer .catalog-card {
 position:relative;display:grid;grid-template-rows:max-content max-content max-content max-content;align-items:start;align-self:start;
 width:100%;height:max-content;min-width:0;min-height:0;padding:0 2px 3px;
 border:0;border-radius:10px;box-shadow:none;background:none;text-align:left;
 color:#5a4b31;opacity:1;filter:none;
}
#build-drawer .catalog-card:disabled {transform:none;cursor:not-allowed}
#build-drawer .catalog-card:enabled:hover {filter:none}
#build-drawer .catalog-card:enabled:hover .catalog-card-title {color:#1488b6}
#build-drawer .catalog-card:enabled:hover .catalog-item-icon {filter:brightness(1.07)}
#build-drawer .catalog-card-title {
 display:flex;align-items:center;justify-content:center;min-height:32px;
 font-size:13px;line-height:16px;text-align:center;color:#237c99;overflow-wrap:anywhere;
}
#build-drawer .catalog-card-body {
 display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;
 min-height:125px;padding:0;border:solid transparent;border-width:18px 19px 21px 20px;
 border-image:url('./catalog-art/card.png') 18 19 21 20 fill /18px 19px 21px 20px /0 stretch;
}
#build-drawer .catalog-card-art {display:grid;place-items:center;flex:none;width:88px;height:85px;border-radius:8px;background:#fff}
#build-drawer .catalog-item-icon {display:block;width:82px;height:79px;max-width:100%;object-fit:contain;flex:none}
#build-drawer .catalog-card-details {display:flex;flex-direction:column;justify-content:center;gap:5px;min-width:0}
#build-drawer .catalog-card-body[data-has-details=false] .catalog-card-details {display:none}
#build-drawer .catalog-stat {display:block;color:#426b4d;font-size:11px;font-weight:700;line-height:15px;overflow-wrap:anywhere}
#build-drawer .catalog-card-price {
 display:flex;align-items:center;justify-content:center;align-self:center;justify-self:center;gap:4px;
 min-width:105px;min-height:30px;padding:2px 10px;margin-top:1px;
 border:0;background:url('./catalog-art/price-button-coins-up.png') center/100% 100% no-repeat;
 color:#fff;font-size:14px;line-height:22px;font-weight:900;text-shadow:0 1px #438322;
}
#build-drawer .catalog-card:enabled:hover .catalog-card-price {background-image:url('./catalog-art/price-button-coins-over.png')}
#build-drawer .catalog-card:enabled:active .catalog-card-price {background-image:url('./catalog-art/price-button-coins-down.png')}
#build-drawer .catalog-card-price[data-currency=cash] {background-image:url('./catalog-art/price-button-cash-up.png');text-shadow:0 1px #235d88}
#build-drawer .catalog-card:enabled:hover .catalog-card-price[data-currency=cash] {background-image:url('./catalog-art/price-button-cash-over.png')}
#build-drawer .catalog-card:enabled:active .catalog-card-price[data-currency=cash] {background-image:url('./catalog-art/price-button-cash-down.png')}
#build-drawer .catalog-currency-icon {display:inline-block;flex:none;width:18px;height:18px;background-position:center;background-repeat:no-repeat;background-size:contain}
#build-drawer .catalog-card-price[data-currency=coins] .catalog-currency-icon {background-image:url('./catalog-art/price-coins.png')}
#build-drawer .catalog-card-price[data-currency=cash] .catalog-currency-icon {background-image:url('./catalog-art/price-cash.png')}
#build-drawer .catalog-currency-label {font-size:11px}
#build-drawer .catalog-card-requirement {min-height:14px;padding:0 3px;color:#537e38;font-size:11px;line-height:14px;font-weight:700;text-align:center;overflow-wrap:anywhere}
#build-drawer .catalog-card[data-lock-reason] .catalog-card-title {color:#6d7167}
#build-drawer .catalog-card[data-lock-reason] .catalog-card-body {border-right-width:22px;border-image-source:url('./catalog-art/card-locked.png');border-image-slice:18 22 21 20 fill;border-image-width:18px 22px 21px 20px}
#build-drawer .catalog-card[data-lock-reason] .catalog-card-price {filter:saturate(.2)}
#build-drawer .catalog-card[data-lock-reason] .catalog-item-icon {opacity:.8;filter:grayscale(.45)}
#build-drawer .catalog-card[data-lock-reason] .catalog-card-requirement {color:#946044}
#build-drawer .catalog-empty {grid-column:1/-1;padding:20px;font-size:12px;text-align:center}
#build-drawer #quests-panel {min-height:0;overflow:auto;padding:14px 17px;background:#fff9e9}
.catalog-category-icon[data-category=residence] {background-image:url('./catalog-art/tab-residence-inactive.png')}
.catalog-category-icon[data-category=business] {background-image:url('./catalog-art/tab-business-inactive.png')}
.catalog-category-icon[data-category=decorRoads] {background-image:url('./catalog-art/tab-decorations-inactive.png')}
.catalog-category-icon[data-category=farming] {background-image:url('./catalog-art/tab-goods-inactive.png')}
.catalog-category-icon[data-category=municipal] {background-image:url('./catalog-art/tab-municipal-inactive.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=residence],.catalog-category:enabled:hover .catalog-category-icon[data-category=residence] {background-image:url('./catalog-art/tab-residence-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=business],.catalog-category:enabled:hover .catalog-category-icon[data-category=business] {background-image:url('./catalog-art/tab-business-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=decorRoads],.catalog-category:enabled:hover .catalog-category-icon[data-category=decorRoads] {background-image:url('./catalog-art/tab-decorations-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=farming],.catalog-category:enabled:hover .catalog-category-icon[data-category=farming] {background-image:url('./catalog-art/tab-goods-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=municipal],.catalog-category:enabled:hover .catalog-category-icon[data-category=municipal] {background-image:url('./catalog-art/tab-municipal-active.png')}
@media(max-width:790px) {
 #build-drawer {width:calc(100% - 24px)}
 #build-drawer #catalog {grid-template-columns:repeat(2,minmax(0,220px));gap:12px 8px;padding:12px}
 #build-drawer #catalog[data-page-size="6"] {grid-template-columns:repeat(3,minmax(0,1fr))}
 #catalog-categories {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(64px,auto);align-items:stretch;min-height:138px;padding:4px 8px;gap:2px;overflow:visible;background:#126b8e}
 #catalog-categories .catalog-category {width:100%;min-width:0;max-width:none;min-height:64px;padding:2px;gap:2px;justify-content:center;border-radius:7px}
 #catalog-categories .catalog-category-label {min-width:0;min-height:24px;line-height:12px;overflow-wrap:anywhere}
 .catalog-category-icon {width:44px;height:38px}
}
@media(max-width:480px) {
 #build-drawer {width:calc(100% - 20px);max-height:calc(100% - var(--drawer-bottom) - 60px);border-width:3px;border-radius:14px}
 #build-drawer .drawer-heading {min-height:39px;padding:4px 7px 4px 9px}
 #build-drawer .panel-tabs button {font-size:12px;padding:2px 10px}
 #catalog-categories {grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(64px,auto);min-height:201px;padding:2px 4px 3px;gap:2px;background:#126b8e}
 #catalog-categories .catalog-category {min-height:64px;font-size:10px;line-height:12px;padding:2px 1px;gap:1px}
 #catalog-categories .catalog-category-label {min-height:24px}
 .catalog-category-icon {width:40px;height:34px}
 #build-drawer .build-heading {min-height:53px;padding:8px 11px;gap:5px}
 #build-drawer #catalog-section-title {font-size:16px;line-height:20px}
 #build-drawer .intro {font-size:10px;line-height:14px}
 #build-drawer #expand-land {font-size:10px;gap:3px;padding:3px 4px}
 #build-drawer #expand-land img {height:25px;width:25px}
 #build-drawer #catalog,#build-drawer #catalog[data-item-count="2"] {grid-template-columns:minmax(0,1fr);gap:10px;padding:10px 8px 12px}
 #build-drawer #catalog[data-page-size="6"] {grid-template-columns:minmax(0,1fr)}
 #build-drawer .catalog-card {grid-template-rows:max-content max-content max-content max-content;gap:5px;padding:0}
 #build-drawer .catalog-card-title {font-size:12px;line-height:15px;min-height:30px}
 #build-drawer .catalog-card-body {flex-direction:row;gap:8px;min-height:96px;border-width:12px 12px 14px 13px;border-image-width:12px 12px 14px 13px}
 #build-drawer .catalog-card[data-lock-reason] .catalog-card-body {border-right-width:14px;border-image-width:12px 14px 14px 13px}
 #build-drawer .catalog-card-art {width:82px;height:76px}
 #build-drawer .catalog-item-icon {width:76px;height:70px}
 #build-drawer .catalog-card-details {width:auto;align-items:flex-start;gap:2px;padding:0}
 #build-drawer .catalog-stat {font-size:10px;line-height:13px;text-align:left}
 #build-drawer .catalog-card-price {min-width:94px;min-height:28px;padding:2px 7px;font-size:13px;line-height:20px}
 #build-drawer .catalog-currency-label {font-size:10px}
 #build-drawer .catalog-card-requirement {font-size:10px;line-height:13px;min-height:26px;padding:0 2px}
}

/* Contain scroll input at the actual scroll surfaces. On short viewports the
 * content body scrolls as a whole so tabs/search/cards/paging stay reachable;
 * the close button stays in the separate, non-scrolling drawer heading. */
#build-drawer #catalog,#build-drawer #buildings-panel,#build-drawer #quests-panel{overscroll-behavior:contain}
@media(max-height:540px){
 #build-drawer{bottom:8px;max-height:calc(100% - 16px)}
 #build-drawer #buildings-panel{overflow-y:auto;overflow-x:hidden}
 #build-drawer #catalog{flex:0 0 auto;overflow:visible}
}
/* Native MarketAssets tab art: verified character IDs, no category-image fallback. */
.catalog-category-icon[data-category=subscriptions] {background-image:url('./catalog-art/tab-subscriptions-inactive.png')}
.catalog-category-icon[data-category=specials] {background-image:url('./catalog-art/tab-specials-inactive.png')}
.catalog-category-icon[data-category=expansion] {background-image:url('./catalog-art/tab-expansion-inactive.png')}
.catalog-category-icon[data-category=themes] {background-image:url('./catalog-art/tab-themes-inactive.png')}
.catalog-category-icon[data-category=wonders] {background-image:url('./catalog-art/tab-wonders-inactive.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=subscriptions],.catalog-category:enabled:hover .catalog-category-icon[data-category=subscriptions] {background-image:url('./catalog-art/tab-subscriptions-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=specials],.catalog-category:enabled:hover .catalog-category-icon[data-category=specials] {background-image:url('./catalog-art/tab-specials-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=expansion],.catalog-category:enabled:hover .catalog-category-icon[data-category=expansion] {background-image:url('./catalog-art/tab-expansion-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=themes],.catalog-category:enabled:hover .catalog-category-icon[data-category=themes] {background-image:url('./catalog-art/tab-themes-active.png')}
.catalog-category[aria-selected=true] .catalog-category-icon[data-category=wonders],.catalog-category:enabled:hover .catalog-category-icon[data-category=wonders] {background-image:url('./catalog-art/tab-wonders-active.png')}
/* Native Market2 has no verified MarketAssets marketIcons_extras/hybrids symbol in the selected SWF; keep those tabs text-only rather than borrowing another icon. */
