/* Reference layout: compact mobile, with a wider desktop marketplace. */
:root { --ref-gap: 12px; --ref-rail: 212px; --ref-header: 118px; }
body { background: #f7fafb; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
body > main.wrap, .wrap { width: min(1100px,100%); max-width: 1100px; padding-inline: 16px; margin-inline: auto; }
.reference-ui #marketplaceMain.wrap { padding-top: 4px; }
.reference-ui #listingsView .market-shell { margin-top: 0; padding-top: 0; }
.reference-ui #listingsView .category-rail-head .reference-category-toggle { min-height: 32px; height: 32px; }
.market-view-switch-frame, #mobileHome, #listingsView .discovery-hero, #listingsTopBanners, #resultsTopBanners { display: none !important; }
#listingsView .market-shell { display: grid; grid-template-columns: var(--ref-rail) minmax(0,1fr); gap: var(--ref-gap); align-items: start; }
#listingsView .category-rail { display: block; min-width: 0; position: sticky; top: calc(var(--ref-header) + 8px); padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#listingsView .category-rail-head { display: flex; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--line); gap: 4px; }
#listingsView .category-rail-title { font-size: 15px; font-weight: 400; margin: 0; }
#listingsView .category-rail-head .category-all { display: none; }
#listingsView #categoryBrowser { display: block; border: 0; padding: 0; background: none; box-shadow: none; }
#categoryBrowser > summary { display: none; }
#categoryBrowser > #categoryNav { display: block; max-height: calc(100dvh - var(--ref-header) - 160px); min-height: 240px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; padding: 3px 5px; }
#categoryNav .category-group { padding: 0; margin: 0; border: 0; }
#categoryNav .category-parent, #categoryNav .category-child { display: flex; align-items: center; gap: 6px; min-height: 34px; width: 100%; padding: 5px 8px; font-size: 14px; font-weight: 400; border: 0; border-radius: 7px; background: #fff; color: var(--ink); text-align: left; }
#categoryNav .category-parent .category-label, #categoryNav .category-child .category-label { min-width: 0; flex: 1; white-space: normal; line-height: 1.3; overflow-wrap: break-word; }
#categoryNav .category-count { font-size: 12px; font-weight: 400; color: var(--sub); flex: none; }
#categoryNav button[aria-pressed="true"] { background: var(--petrol-soft); color: var(--petrol); font-weight: 400; }
#categoryNav .category-children { display: none; border: 0; padding: 0 0 1px 7px; }
#categoryNav .category-group:has([aria-pressed="true"]) .category-children { display: block; }
#categoryNav .category-child[hidden] { display: none; }
#categoryNav .category-more { min-height: 32px; font-size: 12px; font-weight: 400; }
#listingsView .market-main { min-width: 0; padding: 0; }
#siteResultsSection .listing-section-heading { margin: 0 0 8px; min-height: 42px; gap: 6px; align-items: center; }
#siteResultsSection .listing-section-heading h2 { font-size: 16px; font-weight: 400; line-height: 1.3; margin: 0; }
#siteResultsSection .section-eyebrow, #visibleListingCount { display: none; }
#grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--ref-gap); }
#grid .listing { display: block; min-height: 0; min-width: 0; border-radius: 9px; box-shadow: 0 2px 6px #083f4c06; overflow: hidden; }
#grid .photo { height: 185px; min-height: 0; aspect-ratio: auto; background: #eff4f5; }
#grid .photo img { object-fit: contain; }
#grid .body { padding: 9px; }
#grid .body h2 { min-height: 0; font-size: 14px; font-weight: 400; margin: 0 0 6px; }
#grid .title-open { -webkit-line-clamp: 2; min-height: 0; line-height: 1.35; font-size: inherit; font-weight: 400; }
#grid .price { font-size: 20px; font-weight: 800; line-height: 1.25; color: var(--petrol); letter-spacing: -.3px; }
#grid .meta { display: block; font-size: 12px; border: 0; margin: 5px 0 0; padding: 0; }
#grid .meta span { display: block; }
#grid .meta span + span, #grid .pill { display: none; }
#grid .fav { width: 36px; height: 36px; min-height: 36px; top: 3px; right: 3px; font-size: 22px; background: #ffffffd9; border: 0; }
#grid .loading, #grid .empty { grid-column: 1/-1; padding: 24px 8px; }
.reference-ui header { position: sticky; top: 0; z-index: 30; background: #fff; box-shadow: 0 2px 7px #083f4c06; }
.reference-ui header .head.wrap { display: grid; grid-template-columns: minmax(0,1fr) 44px 64px; grid-template-areas: 'brand favorites account' 'search search search'; height: auto; padding-block: 7px 9px; gap: 5px 8px; }
.reference-ui .head .brand { grid-area: brand; }
.reference-ui .head .brand-logo-frame { width: 164px; height: 43px; }
.reference-ui .head .brand-logo { width: 100%; height: 100%; object-fit: contain; transform: none; }
.reference-ui .head #accountBtn { grid-area: account; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 43px; min-height: 43px; font-size: 0; padding: 0; border: 0; background: transparent; }
.reference-ui .head #accountBtn::before { content: ''; width: 25px; height: 25px; border-radius: 50%; background: var(--petrol) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M6 20v-2a6 6 0 0 1 12 0v2'/%3E%3C/svg%3E") center/22px no-repeat; }
.reference-ui .head #accountBtn::after { content: 'Hesabım'; font-size: 12px; font-weight: 700; line-height: 16px; }
.reference-ui .head .favorites-action { grid-area: favorites; display: grid; place-items: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; font-size: 24px; }
.reference-ui .head .favorites-action .favorites-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.reference-ui.reference-discover header .head #searchForm { display: none; }
.reference-ui .head > .primary { display: none; }
.reference-ui header .head .search { display: flex; grid-area: search; order: initial; width: 100%; max-width: none; min-width: 0; margin: 0; height: 42px; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 10px; background: #f9fcfd; box-shadow: 0 1px 5px #083f4c05; }
.reference-ui #searchScope { display: none; }
.reference-ui #searchForm input { font-size: 16px; padding: 8px 12px; width: 100%; min-width: 0; background: transparent; }
.reference-ui #searchForm button { min-width: 36px; min-height: 40px; border: 0; background: transparent; color: var(--petrol); padding: 6px; }
.reference-ui #searchForm button[type='submit'] { font-size: 13px; font-weight: 700; }
.reference-ui #searchForm .reference-clear-search { font-size: 21px; }
.reference-ui #searchForm .reference-search-filter { width: 38px; }
.reference-ui svg { width: 20px; height: 20px; flex-shrink: 0; }
.reference-ui button[hidden] { display: none !important; }
.reference-ui button[aria-disabled='true'] { opacity: .48; cursor: help; }
.reference-ui .reference-toolbar { margin-block: 8px; }
.reference-category-strip { display: none; }
.reference-controls { display: grid; grid-template-columns: 1.25fr 1fr .75fr 1fr; gap: 8px; }
.reference-controls > button, .reference-sort { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--ink); box-shadow: 0 2px 5px #083f4c05; font-size: 14px; }
.reference-controls > button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-sort select { border: 0; background: transparent; min-width: 0; width: 100%; font-size: 14px; color: var(--ink); padding: 0; }
.reference-chips { display: flex; gap: 7px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; padding: 7px 0 2px; }
.reference-chips > button { display: flex; align-items: center; justify-content: center; flex: none; gap: 6px; padding: 7px 12px; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 13px; }
.reference-chips button[aria-pressed='true'] { background: var(--petrol-soft); border-color: var(--petrol); color: var(--petrol); }
.reference-ui .reference-toolbar { display: flex; align-items: center; gap: 10px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; padding: 3px 1px 7px; }
.reference-ui .reference-toolbar::-webkit-scrollbar { display: none; }
.reference-ui .reference-controls, .reference-ui .reference-chips { display: contents; }
.reference-ui .reference-all-filter,
.reference-ui .reference-chips [data-quick='added'],
.reference-ui .reference-chips [data-quick='trade'],
.reference-ui .reference-chips [data-quick='seller'],
.reference-ui .reference-clear-filters { display: none !important; }
.reference-ui #referenceLocation { order: 1; flex: 0 0 150px; }
.reference-ui #referenceLocation svg:last-child { width: 16px; margin-left: auto; }
.reference-ui .reference-sort { order: 2; flex: 0 0 165px; }
.reference-ui .reference-chips [data-quick='urgent'] { order: 3; flex: 0 0 124px; }
.reference-ui .reference-chips [data-quick='drop'] { order: 4; flex: 0 0 178px; }
.reference-ui #referenceFilter { order: 5; flex: 0 0 145px; }
.reference-ui .reference-chips [data-quick='urgent'][aria-disabled='true'] { opacity: 1; color: #d84a48; border-color: #f1dddd; background: #fff6f6; }
.reference-ui .reference-chips [data-quick='drop'][aria-disabled='true'] { opacity: 1; color: #16a873; border-color: #d9eee5; background: #f6fcf9; }
.reference-category-toggle { display: grid; place-items: center; flex: none; width: 32px; height: 36px; border: 0; background: none; color: var(--petrol); padding: 0; margin-left: auto; }
.reference-category-toggle svg { width: 16px; }
.reference-location-shortcut { display: flex; align-items: center; justify-content: center; gap: 5px; width: calc(100% - 10px); margin: 5px; padding: 8px 4px; min-height: 38px; background: var(--petrol-soft); color: var(--petrol); border: 0; border-radius: 7px; font-size: 12px; }
.reference-ui #categoryBrowser > #categoryNav { max-height: calc(100dvh - var(--ref-header) - 220px); }
.categories-hidden #listingsView .market-shell { grid-template-columns: minmax(0,1fr); }
.categories-hidden #listingsView .category-rail { display: none; }
.reference-ui #referenceCategoryAll { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; min-height: 34px; padding: 5px 8px; border: 0; border-radius: 7px; font-size: 14px; font-weight: 400; color: var(--petrol); background: var(--petrol-soft); }
.reference-result-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.reference-result-tools button { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 36px; min-height: 36px; padding: 6px; background: #fff; border: 1px solid var(--line); color: var(--petrol); border-radius: 7px; font-size: 13px; }
.reference-result-tools button[aria-pressed='true'] { background: var(--petrol); color: #fff; }
.reference-photo-count { position: absolute; bottom: 4px; left: 4px; padding: 2px 5px; background: #0009; color: #fff; font-size: 12px; border-radius: 5px; pointer-events: none; }
.reference-ui #grid { align-items: start; }
.reference-ui #grid .listing { height: 100%; }
.reference-ui #grid .title-open { display: -webkit-box; min-height: 32px; }
.reference-ui #listingsView.list-mode #grid { grid-template-columns: minmax(0,1fr); }
.reference-ui #listingsView.list-mode #grid .listing { display: grid; grid-template-columns: 34% minmax(0,1fr); }
.reference-ui #listingsView.list-mode #grid .photo { height: 150px; }
.reference-ui #filterPanel:not([open]) { display: none; }
.reference-ui #filterPanel { margin: 0; padding: 0; border: 0; }
.reference-ui #filterPanel > summary { display: none; }
.reference-ui #filterPanel[open]::before { content: ''; position: fixed; inset: 0; background: #083f4c66; z-index: 1000; }
.reference-ui #filterPanel[open] .filter { display: grid; grid-template-columns: 1fr 1fr; position: fixed; width: min(620px,100%); left: 50%; right: auto; transform: translateX(-50%); bottom: 0; top: auto; z-index: 1001; max-height: 86dvh; overflow: auto; overscroll-behavior: contain; background: #fff; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
.reference-ui #filterPanel .mobile-filter-close { display: block; grid-column: 1/-1; min-height: 44px; border: 0; border-bottom: 1px solid var(--line); width: 100%; font-size: 14px; background: #fff; color: var(--petrol); }
.reference-ui #filterPanel :is(input,select,button) { min-height: 42px; }
.reference-ui.filter-sheet-open { overflow: hidden; }
.reference-ui .mobile-bottom-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; inset: auto 0 0; width: 100%; margin: 0; gap: 4px; z-index: 80; min-height: 66px; padding: 4px max(8px,calc((100vw - 1080px)/2)) calc(4px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 8px #083f4c09; }
.reference-ui .mobile-bottom-nav [data-mobile-destination='home'] { display: none; }
.reference-ui .mobile-bottom-nav button { min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 9px; background: transparent; color: var(--sub); padding: 3px; }
.reference-ui .mobile-bottom-nav button.active { background: var(--petrol-soft); color: var(--petrol); box-shadow: inset 0 2px var(--petrol); }
.reference-ui .mobile-nav-label { font-size: 12px; }
.reference-ui .mobile-nav-logo img { object-fit: contain; width: 44px; height: 27px; }
.reference-ui .reference-post { position: fixed; right: max(12px,calc((100vw - 1080px)/2)); bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; padding: 0; background: transparent; color: var(--petrol-dark); }
.reference-ui.account-page .reference-post { display: none; }
.reference-post > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #ff8a00; color: #fff; font-size: 38px; line-height: 1; box-shadow: 0 3px 8px #c96a0022; }
.reference-post strong { font-size: 12px; background: #fffffff2; border-radius: 4px; padding: 1px 4px; }
.reference-ui .mobile-chat-button { right: auto; left: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); }
#messages .message-sheet { width:min(920px,100%); }
#messages .message-content { display:grid; grid-template-columns:280px minmax(0,1fr); gap:12px; }
#messages #messageConversationList { grid-row:span 3; overflow:auto; }
@media(max-width:719px){#messages .sheet{min-height:100dvh;border-radius:0;}#messages .message-content{display:block;}#messages[data-message-view='inbox'] :is(.message-delivery,.message-thread,.message-compose){display:none;}#messages[data-message-view='thread'] #messageConversationList{display:none;}#messages .message-compose{position:sticky;bottom:0;padding-bottom:env(safe-area-inset-bottom);background:#fff;}}
.reference-ui:has(.modal.open) .reference-post, .reference-ui:has(.modal.open) .mobile-chat-button, .reference-ui.message-modal-open .reference-post, .reference-ui.message-modal-open .mobile-chat-button, .reference-ui.message-modal-open .mobile-bottom-nav, .reference-ui.blocking-modal-open .reference-post, .reference-ui.blocking-modal-open .mobile-chat-button, .reference-ui.blocking-modal-open .mobile-bottom-nav, .reference-ui.filter-sheet-open .reference-post, .reference-ui.filter-sheet-open .mobile-chat-button, .reference-ui.reference-keyboard .mobile-bottom-nav, .reference-ui.reference-keyboard .reference-post { display: none !important; }
.reference-ui footer { margin-bottom: 64px; }
.reference-ui #webSearchView .web-search-hero { min-height: 0; padding: 12px; border-radius: 10px; }
.reference-ui #webSearchView .web-search-brand { font-size: 18px; margin: 0 auto 8px; transform: none; }
.reference-ui #webSearchView .web-search-brand img { width: 80px; }
.reference-ui #webSearchView .web-results-main { background: none; padding: 10px 0; border: 0; }
.reference-ui #webSearchView .web-popular-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.reference-ui #webSearchView .web-popular-product { display: flex; flex-direction: column; border-radius: 9px; }
.reference-ui #webSearchView .web-popular-product-select { display: block; }
.reference-ui #webSearchView .web-popular-photo { width: 100%; height: 170px; padding: 10px; }
.reference-ui #webSearchView .web-popular-copy { padding: 8px; }
.reference-ui #webSearchView .web-popular-copy strong { font-size: 14px; line-height: 1.35; -webkit-line-clamp: 2; }
.reference-ui #webSearchView .web-popular-offer { flex-wrap: wrap; gap: 3px; min-height: 52px; padding: 7px 8px; }
.reference-ui #webSearchView .web-popular-offer-price strong { font-size: 18px; }
.reference-ui #webSearchView .web-popular-offer-price small { display: none; }
.reference-ui #webSearchView .discovery-checked { font-size: 12px; }
.reference-ui #webSearchView .mobile-prices-action { display: block; margin-top: auto; }
.reference-ui #storesView .public-store-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.reference-ui #storesView .public-store-card { border-radius: 10px; padding: 12px; min-height: 140px; }
.reference-ui .store-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.reference-ui .store-pagination button { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 12px; }
.reference-ui .mobile-account-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.reference-ui .mobile-account-links button { min-height: 44px; border-radius: 8px; border: 1px solid var(--line); color: var(--petrol); background: var(--petrol-soft); }
.reference-ui #account .sheet { max-width: 650px; }
.reference-ui.information-route .mobile-bottom-nav, .reference-ui.information-route .reference-post { display: none; }
.reference-desktop-details { display: none; }
.reference-desktop-label { display: none; }
/* Desktop only: leave the approved mobile and tablet layouts unchanged. */
@media (min-width: 1100px) {
  .reference-ui { --ref-desktop-width: 1440px; }
  .reference-ui .wrap, .reference-ui #marketplaceMain.wrap { width: min(var(--ref-desktop-width),100%); max-width: var(--ref-desktop-width); padding-inline: 24px; }
  .reference-ui header .head.wrap { grid-template-columns: 212px minmax(0,1fr) 44px 80px; grid-template-areas: 'brand search favorites account'; gap: 16px; min-height: 76px; padding-block: 12px; }
  .reference-ui.reference-discover header .head.wrap { grid-template-columns: minmax(0,1fr) 44px 80px; grid-template-areas: 'brand favorites account'; }
  .reference-ui header .head .search { height: 46px; border-radius: 12px; background: #f7fafb; }
  .reference-ui #searchForm input { padding-inline: 16px; }
  .reference-ui #searchForm button[type='submit'] { margin: 4px; padding-inline: 20px; min-height: 36px; border-radius: 8px; background: var(--petrol); color: #fff; font-size: 14px; }
  .reference-ui #searchForm .reference-search-filter { margin-right: 6px; }
  .reference-ui .head #accountBtn { width: 80px; height: 48px; border-radius: 10px; }
  .reference-ui .reference-toolbar { padding-block: 6px 2px; margin-block: 6px; }
  .reference-ui .reference-controls { grid-template-columns: 1.2fr 1fr .7fr .9fr; max-width: 680px; }
  .reference-ui .reference-controls > button, .reference-ui .reference-sort { min-height: 40px; box-shadow: none; }
  .reference-ui .reference-chips > button { border-radius: 20px; min-height: 36px; padding-inline: 13px; }
  .reference-ui #listingsView .category-rail { border-radius: 12px; }
  .reference-ui #listingsView .category-rail-head { padding: 10px; background: #f0f7f9; }
  .reference-ui #categoryNav .category-parent, .reference-ui #categoryNav .category-child { margin-bottom: 0; }
  .reference-ui #categoryNav .category-count { min-width: 25px; padding: 2px 5px; text-align: center; border-radius: 5px; background: #f1f5f6; font-weight: 400; }
  .reference-ui #categoryNav button[aria-pressed='true'] { box-shadow: inset 3px 0 var(--petrol); }
  .reference-ui #siteResultsSection .listing-section-heading { margin-bottom: 10px; min-height: 46px; }
  .reference-ui .reference-result-tools { padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
  .reference-ui .reference-result-tools button { border: 0; }
  .reference-ui .reference-result-tools .reference-desktop-label { display: inline; font-size: 13px; }
  .reference-ui .reference-result-tools button:has(.reference-desktop-label) { gap: 7px; padding-inline: 10px; }
  .reference-ui #listingsView:not(.list-mode) #grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .reference-ui #grid .photo { height: 175px; }
  .reference-ui #grid .listing { border-radius: 12px; border-color: #d9e5e9; box-shadow: 0 2px 5px #083f4c05; }
  .reference-ui #grid .photo { border-bottom: 1px solid #e5edef; background: #f1f5f6; }
  .reference-ui #grid .body { padding: 12px; }
  .reference-ui #grid .body h2 { font-size: 14px; }
  .reference-ui #grid .title-open { min-height: 38px; }
  .reference-ui #grid .price { font-size: 21px; }
  .reference-ui #grid .fav:not(.on) { color: #607a84; }
  .reference-ui #grid .fav.on { color: #cf6500; background: #fff3e2; }
  .reference-ui #grid .meta { display: none; }
  .reference-ui #grid .reference-desktop-details { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf2f4; color: var(--sub); font-size: 12px; line-height: 1.4; }
  .reference-desktop-details > span { min-width: 0; overflow-wrap: anywhere; }
  .reference-detail-category { justify-self: start; padding: 3px 8px; border-radius: 5px; background: #eef6f8; font-weight: 400; color: var(--petrol); }
  .reference-detail-date { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }
  .reference-detail-location { grid-column: 1/-1; }
  .reference-ui #listingsView.list-mode #grid { gap: 10px; }
  .reference-ui #listingsView.list-mode #grid .listing { grid-template-columns: 190px minmax(0,1fr); }
  .reference-ui #listingsView.list-mode #grid .photo { height: 145px; border-bottom: 0; border-right: 1px solid #e5edef; }
  .reference-ui #listingsView.list-mode #grid .body { display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: center; align-items: start; gap: 14px 24px; padding: 18px 22px; }
  .reference-ui #listingsView.list-mode #grid .body h2 { margin: 0; font-size: 16px; }
  .reference-ui #listingsView.list-mode #grid .title-open { min-height: 0; }
  .reference-ui #listingsView.list-mode #grid .price { text-align: right; font-size: 23px; }
  .reference-ui #listingsView.list-mode #grid .reference-desktop-details { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 0; }
  .reference-ui #listingsView.list-mode #grid .reference-detail-date { margin-left: auto; }
  .reference-ui #webSearchView .web-popular-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
  .reference-ui #webSearchView .web-popular-product { overflow: hidden; border-radius: 12px; border: 1px solid #d9e5e9; box-shadow: 0 2px 5px #083f4c05; }
  .reference-ui #webSearchView .web-popular-copy { padding: 10px 12px; }
  .reference-ui #webSearchView .web-popular-offer { padding: 9px 12px; }
  .reference-ui #webSearchView .web-popular-copy small, .reference-ui #webSearchView .web-popular-offer-meta, .reference-ui #webSearchView .web-popular-offer-meta strong { font-size: 12px; }
  .reference-ui #webSearchView .mobile-prices-action { width: calc(100% - 20px); margin: auto 10px 10px; min-height: 40px; padding: 8px 12px; border: 1px solid #bbd5dd; border-radius: 8px; background: var(--petrol-soft); color: var(--petrol); font-size: 14px; font-weight: 600; cursor: pointer; }
  .reference-ui #storesView .public-store-card { border: 1px solid #d9e5e9; box-shadow: 0 2px 5px #083f4c05; padding: 16px; }
  .reference-ui #filterPanel[open] .filter { bottom: auto; top: 50%; transform: translate(-50%,-50%); border-radius: 16px; padding: 18px 24px 24px; max-height: calc(100dvh - 64px); box-shadow: 0 12px 40px #083f4c22; }
  .reference-ui .mobile-bottom-nav { position: sticky; inset: auto; top: 76px; z-index: 80; width: min(var(--ref-desktop-width),100%); min-height: 60px; margin: 0 auto; padding: 6px 24px; gap: 12px; border-top: 0; border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px #083f4c0a; }
  .reference-ui .mobile-bottom-nav button { flex-direction: row; gap: 10px; min-height: 48px; }
  .reference-ui .mobile-nav-label { font-size: 14px; font-weight: 600; }
  .reference-ui .mobile-bottom-nav [data-mobile-destination='post'] { background: #ff8a00; color: #fff; font-weight: 800; box-shadow: 0 2px 8px #c96a0033; }
  .reference-ui .mobile-chat-button { left: 24px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 81; }
  .reference-ui :is(button,select,input,a):focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; }
}
@media (min-width: 1100px) and (hover: hover) {
  .reference-ui #grid .listing:hover, .reference-ui #webSearchView .web-popular-product:hover, .reference-ui #storesView .public-store-card:hover { border-color: #91b4bf; box-shadow: 0 4px 14px #083f4c10; }
  .reference-ui #categoryNav button:hover, .reference-ui .head #accountBtn:hover { background: var(--petrol-soft); }
  .reference-ui .reference-controls > button:hover, .reference-ui .reference-chips > button:not([aria-disabled='true']):hover { border-color: var(--petrol); }
}
@media (min-width: 1440px) {
  .reference-ui .reference-toolbar { display: flex; align-items: center; gap: 10px; padding-block: 10px; }
  .reference-ui .reference-chips { padding-block: 2px; }
  .reference-ui #listingsView:not(.list-mode) #grid,
  .reference-ui #webSearchView .web-popular-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (min-width: 1800px) {
  .reference-ui { --ref-desktop-width: 1680px; --ref-rail: 228px; }
  .reference-ui #listingsView:not(.list-mode) #grid,
  .reference-ui #webSearchView .web-popular-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .reference-ui #storesView .public-store-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  :root { --ref-gap: 7px; --ref-rail: 110px; }
  .reference-ui { --mobile-nav-height: 72px; }
  body > main.wrap, .wrap { padding-inline: 8px; width: 100%; }
  .reference-ui #listingsView .market-shell { grid-template-columns: minmax(0,1fr); }
  .reference-ui #listingsView .category-rail { display: none; }
  #listingsView .category-rail-head { padding: 5px; min-height: 36px; }
  #listingsView .category-rail-title { font-size: 12px; }
  #categoryBrowser > #categoryNav { padding: 3px; }
  #categoryNav .category-parent, #categoryNav .category-child { gap: 4px; padding: 4px; font-size: 12px; min-height: 32px; }
  #categoryNav .category-count { font-size: 12px; }
  #siteResultsSection .listing-section-heading h2 { font-size: 12px; }
  #grid .photo { height: 100px; }
  #grid .body { padding: 6px; }
  #grid .body h2 { font-size: 12px; }
  #grid .price { font-size: 14px; }
  #grid .meta { font-size: 12px; }
  #grid .fav { width: 32px; height: 32px; min-height: 32px; font-size: 20px; }
  .reference-ui header .head.wrap { padding: 5px 8px 7px; gap: 3px 8px; }
  .reference-ui .head .brand-logo-frame { width: 134px; height: 34px; }
  .reference-ui .head .brand-logo { width: 100%; height: 100%; transform: none; }
  .reference-ui .mobile-bottom-nav {
    inset: auto 10px max(7px,env(safe-area-inset-bottom));
    width: auto;
    min-height: 62px;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 3px;
    padding: 4px;
    border: 1px solid #ffffff55;
    border-radius: 999px;
    background: rgba(8,63,76,.62);
    box-shadow: 0 10px 28px #00000035, inset 0 1px #ffffff20;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
  }
  .reference-ui .mobile-bottom-nav button {
    min-height: 52px;
    gap: 2px;
    padding: 3px 2px;
    border-radius: 999px;
    color: #f5f7f7;
    transition: background-color .16s ease, color .16s ease;
  }
  .reference-ui .mobile-bottom-nav button.active {
    color: #fff;
    background: #ffffff1c;
    box-shadow: inset 0 0 0 1px #ffffff1a, 0 3px 12px #00000024;
  }
  .reference-ui .mobile-bottom-nav .mobile-nav-icon { width: 27px; height: 24px; color: inherit; }
  .reference-ui .mobile-bottom-nav .mobile-nav-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
  .reference-ui .mobile-bottom-nav .mobile-nav-logo { width: 43px; height: 25px; }
  .reference-ui .mobile-bottom-nav .mobile-nav-logo img { width: 43px; height: 25px; }
  .reference-ui .mobile-bottom-nav .mobile-nav-label { color: inherit; font-size: 11px; line-height: 13px; font-weight: 700; }
  .reference-ui .mobile-chat-button { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .reference-ui .reference-toolbar { display: flex; gap: 6px; margin-block: 6px 8px; padding-bottom: 5px; }
  .reference-ui .reference-category-strip { display: flex; gap: 9px; margin: 7px 0 5px; padding: 2px 1px 5px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
  .reference-ui .reference-category-strip::-webkit-scrollbar { display: none; }
  .reference-ui .reference-category-shortcut { display: grid; grid-template-rows: 54px auto; justify-items: center; gap: 4px; flex: 0 0 62px; min-width: 62px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 11px; line-height: 1.15; scroll-snap-align: start; }
  .reference-ui .reference-category-shortcut > svg { grid-row: 1; width: 52px; height: 52px; padding: 13px; border-radius: 50%; border: 1px solid #dbe6e9; background: #edf6fa; color: #126783; box-shadow: 0 2px 6px #083f4c0b; }
  .reference-ui .reference-category-shortcut > span { grid-row: 2; max-width: 64px; min-height: 25px; overflow: hidden; text-align: center; }
  .reference-ui .reference-category-shortcut[data-tone='mint'] > svg { background: #dcf7ec; color: #116851; }
  .reference-ui .reference-category-shortcut[data-tone='blue'] > svg { background: #e3eefc; color: #15527f; }
  .reference-ui .reference-category-shortcut[data-tone='rose'] > svg { background: #fce8eb; color: #a72b3b; }
  .reference-ui .reference-category-shortcut[data-tone='amber'] > svg { background: #fff0d7; color: #9a5e10; }
  .reference-ui .reference-category-shortcut[data-tone='violet'] > svg { background: #f0e7fb; color: #6625a0; }
  .reference-ui .reference-category-shortcut[data-tone='sky'] > svg { background: #e1f0fb; color: #126389; }
  .reference-ui .reference-category-shortcut[aria-pressed='true'] { color: var(--petrol-dark); }
  .reference-ui .reference-category-shortcut[aria-pressed='true'] > svg { border: 3px solid #fff; outline: 2px solid #e7781c; background: var(--petrol); color: #fff; box-shadow: 0 3px 9px #083f4c22; }
  .reference-controls > button, .reference-sort { min-height: 43px; border-radius: 13px; box-shadow: 0 2px 7px #083f4c0b; }
  .reference-chips > button { min-height: 40px; border-radius: 13px; box-shadow: 0 2px 7px #083f4c09; }
  .reference-ui .reference-controls, .reference-ui .reference-chips { display: contents; }
  .reference-controls > button, .reference-sort { gap: 3px; min-height: 36px; padding: 5px; font-size: 12px; }
  .reference-sort select { font-size: 12px; }
  .reference-controls svg { width: 15px; height: 15px; }
  .reference-chips { gap: 5px; padding-top: 6px; }
  .reference-chips > button { font-size: 12px; padding: 6px 8px; gap: 4px; min-height: 36px; }
  .reference-chips svg { width: 16px; height: 16px; }
  .reference-ui #referenceLocation { flex-basis: 104px; padding-inline: 8px; }
  .reference-ui .reference-sort { flex-basis: 112px; padding-inline: 8px; }
  .reference-ui .reference-chips [data-quick='urgent'] { flex-basis: 74px; }
  .reference-ui .reference-chips [data-quick='drop'] { flex-basis: 116px; }
  .reference-ui #referenceFilter { flex-basis: 92px; padding-inline: 8px; }
  .reference-ui #categoryNav svg { width: 15px; height: 15px; }
  .reference-ui #referenceCategoryAll { gap: 4px; min-height: 32px; font-size: 12px; padding: 4px; }
  #categoryNav .category-count { font-size: 12px; }
  #categoryNav .category-children { padding-left: 2px; }
  #categoryNav .category-child { border-left: 2px solid var(--line); }
  .reference-ui #siteResultsSection .listing-section-heading { display: flex; flex-wrap: wrap; align-items: center; min-height: 36px; gap: 4px; }
  .reference-ui .reference-reopen { display: none !important; }
  .reference-result-tools { gap: 3px; }
  .reference-result-tools button { min-width: 30px; min-height: 32px; padding: 5px; font-size: 12px; }
  .reference-result-tools svg { width: 17px; height: 17px; }
  .reference-map span { display: none; }
  .reference-ui .reference-reopen { min-width: 90px; }
  .reference-ui .reference-post > span { width: 46px; height: 46px; font-size: 32px; }
  .reference-ui #filterPanel[open] .filter { grid-template-columns: 1fr; }
  .reference-ui #webSearchView .web-popular-grid { gap: 7px; }
  .reference-ui #webSearchView .web-popular-photo { height: 132px; }
  .reference-ui #webSearchView .web-popular-copy strong { font-size: 12px; }
  .reference-ui #webSearchView .web-popular-copy small { font-size: 12px; }
  .reference-ui #webSearchView .web-popular-offer-meta strong { font-size: 12px; }
  .reference-ui #webSearchView .web-popular-offer-price strong { font-size: 15px; }
  .reference-ui #webSearchView .web-popular-offer:nth-child(n+2) { display: none; }
  .reference-ui #webSearchView .web-popular-more { min-height: 34px; font-size: 12px; padding: 5px; }
  .reference-ui #webSearchView .discovery-checked { display: none; }
  .reference-ui #webSearchView .mobile-prices-action { min-height: 36px; width: calc(100% - 12px); margin: auto 6px 6px; font-size: 12px; }
  .reference-ui #storesView .public-store-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .reference-ui #account .sheet { max-width: 100%; }
  .reference-ui #listingsView.list-mode #grid .photo { height: 120px; }
  .reference-ui .toast {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 110;
    text-align: center;
  }
  .reference-ui.blocking-modal-open .toast {
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 130;
  }
  .reference-ui.filter-sheet-open .toast {
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1010;
  }
  .reference-ui .modal.open:not(#account) {
    z-index: 120;
    padding: 0;
    align-items: stretch;
  }
  /* Moderation dialogs are children of the management sheet, so they must
     sit above that sheet instead of sharing the generic mobile modal layer. */
  .reference-ui .modal.open#moderationAction,
  .reference-ui .modal.open#moderationHistory {
    z-index: 2147483646;
  }
  .reference-ui .modal.open:not(#account) > .sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    border-radius: 0;
  }
  .reference-ui .modal.open:not(#account) > .sheet > .sheet-head {
    flex: 0 0 auto;
  }
  .reference-ui .modal.open:not(#account) > .sheet > .content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .reference-ui #messages { z-index: 100; padding: 0; align-items: flex-end; }
  .reference-ui #messages .message-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
  }
  .reference-ui #messages .sheet-head { flex: 0 0 auto; }
  .reference-ui #messages .message-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    overflow: hidden;
    padding: 12px;
  }
  .reference-ui #messages .message-delivery { flex: 0 0 auto; }
  .reference-ui #messages .message-thread {
    flex: 1 1 auto;
    min-height: 96px;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .reference-ui #messages .message-compose {
    position: relative;
    z-index: 2;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: minmax(0,1fr) 88px;
    gap: 8px;
    align-items: stretch;
    margin: 0;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    background: #fff;
  }
  .reference-ui #messages .message-compose textarea {
    min-height: 52px;
    max-height: 88px;
    resize: none;
  }
  .reference-ui #messages .message-compose button {
    width: auto;
    min-height: 52px;
    padding-inline: 12px;
  }
}
