/* Vetra v0.2.5 mobile UX stabilization. Desktop remains intentionally unchanged. */
.mobile-browse-button,.message-mobile-filter-trigger,.profile-mobile-nav,.wizard-mobile-status,.modal-mobile-dock{display:none}
.card-image-track{display:flex;width:100%;transition:transform .24s ease;will-change:transform}.card-image-slide{flex:0 0 100%;min-width:0}.card-image-dots,.card-image-counter{display:none}
.vetra-mobile-sheet{position:fixed;inset:0;z-index:2147483600;display:grid;align-items:end;pointer-events:none}.vetra-mobile-sheet.open{pointer-events:auto}.vetra-mobile-sheet-backdrop{position:absolute;inset:0;border:0;background:rgba(0,0,0,.62);opacity:0;transition:opacity .18s}.vetra-mobile-sheet.open .vetra-mobile-sheet-backdrop{opacity:1}.vetra-mobile-sheet-panel{position:relative;z-index:1;width:100%;max-height:min(82dvh,760px);display:grid;grid-template-rows:auto auto minmax(0,1fr);overflow:hidden;border:1px solid var(--line-strong);border-radius:22px 22px 0 0;background:var(--panel);box-shadow:0 -22px 80px rgba(0,0,0,.5);transform:translateY(105%);transition:transform .2s ease;padding-bottom:env(safe-area-inset-bottom)}.vetra-mobile-sheet.open .vetra-mobile-sheet-panel{transform:translateY(0)}.vetra-mobile-sheet-handle{width:46px;height:5px;border-radius:999px;background:var(--line-strong);margin:8px auto 4px}.vetra-mobile-sheet-panel header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}.vetra-mobile-sheet-panel header button{width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:var(--panel-2);color:var(--text);font-size:1.4rem}.vetra-mobile-sheet-options{overflow:auto;padding:8px 10px 12px;overscroll-behavior:contain}.vetra-mobile-sheet-options>button{display:grid;gap:3px;width:100%;min-height:54px;padding:10px 12px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--text);text-align:left}.vetra-mobile-sheet-options>button:hover,.vetra-mobile-sheet-options>button.active{border-color:rgba(84,198,255,.32);background:rgba(84,198,255,.09)}.vetra-mobile-sheet-options small{color:var(--muted)}

@media(max-width:650px){
  /* Structural viewport rules: solve the overflowing components rather than relying on a hidden broken page. */
  html,body,.app-shell,.main-grid,.content-area,.modal,.modal-card,.profile-modal,.message-center-modal,.storefront-public-modal{width:100%;max-width:100%;min-width:0}
  body{overflow-x:clip}
  img,video,canvas,svg{max-width:100%}
  input,select,textarea,button{max-width:100%}
  .form-grid>*,.profile-detail-grid>*,.profile-summary-grid>*,.conversation-title-block,.conversation-row-copy,.storefront-inventory-section,.public-storefront{min-width:0}
  .modal-card{box-sizing:border-box;padding-bottom:calc(var(--mobile-dock-height,72px) + env(safe-area-inset-bottom) + 18px)}

  /* Keep the excellent global dock available even while a native dialog is in the top layer. */
  .modal-mobile-dock{display:grid;z-index:2147483500}
  #sellModal .modal-mobile-dock{display:none}

  /* Replace the sideways category strip with the existing vertical filter drawer pattern. */
  .category-strip-wrap{display:none}
  .mobile-browse-button{display:inline-flex;align-items:center;justify-content:center}
  .toolbar-controls{grid-template-columns:1fr 1fr!important;gap:.5rem}
  .toolbar-controls .mobile-browse-button,.toolbar-controls .mobile-filter-button{width:100%}
  .toolbar-controls .live-scroll-label{display:none}
  .toolbar-controls #sortSelect{grid-column:1/-1;width:100%}
  .toolbar-controls #viewToggle{display:none}
  .sidebar{width:100%;max-width:100%;overflow-x:clip;overflow-y:auto}
  .sidebar .category-list,.sidebar .segment-list{width:100%}

  /* Visual-first mobile marketplace cards. */
  .listing-wall{gap:.8rem}
  .item-card{width:100%;min-width:0;border-radius:18px}
  .image-stage{touch-action:pan-y;min-width:0}
  .card-image-track{min-width:0}
  .card-image-slide{aspect-ratio:4/3;object-fit:cover;width:100%;height:auto}
  .item-card:hover{transform:none}
  .item-card:hover .item-image{transform:none}
  .card-image-counter{display:block;position:absolute;right:.65rem;bottom:.6rem;z-index:3;padding:.28rem .48rem;border-radius:999px;background:rgba(5,10,18,.78);color:#fff;font-size:.68rem;font-weight:850;backdrop-filter:blur(8px)}
  .card-image-dots{position:absolute;left:50%;bottom:.65rem;z-index:3;display:flex;gap:4px;transform:translateX(-50%);max-width:48%;overflow:hidden}
  .card-image-dots button{width:6px;height:6px;min-height:6px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.45)}
  .card-image-dots button.active{background:#fff;transform:scale(1.25)}
  .item-body{padding:.78rem;gap:.48rem}
  .item-kicker,.item-card>.item-body>.listing-number,.item-card .salesrep-mini,.item-card .item-meta,.item-card .item-description,.item-card .inventory-qty-badge{display:none!important}
  .item-title{min-height:0;font-size:1.02rem;line-height:1.25}
  .price-line{align-items:center;padding-top:0}.price{font-size:1.35rem}.offer{font-size:.7rem}
  .card-actions{grid-template-columns:1fr 1fr;gap:.5rem}.card-actions button{min-height:46px;padding:.55rem .45rem}

  /* Full-screen content destinations use one primary vertical scroll. */
  .profile-modal,.message-center-modal,.storefront-public-modal,.dashboard-modal,.trust-center,.developer-hub-modal{min-height:100dvh;max-height:100dvh;overflow-y:auto;overflow-x:clip;border-radius:0}
  .profile-panel{max-height:none!important;overflow:visible!important;padding-bottom:calc(132px + env(safe-area-inset-bottom))}
  .profile-tabs{display:none!important}
  .profile-modal[data-active-profile-tab]:not([data-active-profile-tab="overview"]) .profile-summary-grid{display:none}
  .profile-modal[data-active-profile-tab]:not([data-active-profile-tab="overview"])>p.eyebrow,.profile-modal[data-active-profile-tab]:not([data-active-profile-tab="overview"])>h2{display:none}
  .profile-mobile-nav{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);left:0;right:0;bottom:calc(var(--mobile-dock-height,72px) + env(safe-area-inset-bottom));z-index:2147483490;height:58px;padding:.25rem .3rem;background:color-mix(in srgb,var(--panel) 96%,transparent);backdrop-filter:blur(18px);border-top:1px solid var(--line)}
  .profile-mobile-nav button{min-height:48px;border:0;background:transparent;color:var(--muted);font-size:.68rem;display:grid;place-items:center;align-content:center;gap:2px;padding:.15rem}.profile-mobile-nav button span{font-size:1rem;color:var(--text)}.profile-mobile-nav button.active{color:var(--brand)}

  /* Message center: vertical selector + either list OR conversation, not two cramped panes. */
  .message-center-tabs{display:none!important}
  .message-mobile-filter-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:48px;padding:.65rem .85rem;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);color:var(--text);font-weight:850}
  .message-center-layout{display:block!important;min-height:0}
  .conversation-list{width:100%;max-height:none!important;overflow:visible!important;border-radius:14px}
  .conversation-pane{display:none;max-height:none!important;min-height:calc(100dvh - 190px)!important;border-radius:14px;overflow:visible!important}
  .message-center-shell.has-selection .conversation-list{display:none}
  .message-center-shell.has-selection .conversation-pane{display:flex}
  .conversation-header{position:relative!important;top:auto!important}
  .message-thread{min-height:42dvh;max-height:none;overflow:visible;padding:.85rem}
  .message-reply-form{position:sticky;bottom:calc(var(--mobile-dock-height,72px) + env(safe-area-inset-bottom));z-index:5;background:var(--panel);padding:.7rem}
  .message-mobile-back{display:inline-flex!important}
  .message-center-modal{padding-bottom:calc(var(--mobile-dock-height,72px) + env(safe-area-inset-bottom) + 12px)!important}

  /* Storefront is a destination, not a half-height panel. */
  .storefront-public-modal{width:100%!important;max-width:100%!important;min-height:100dvh!important;max-height:100dvh!important;overflow-y:auto!important}
  .public-storefront{min-height:calc(100dvh - var(--mobile-dock-height,72px))}

  /* Listing wizard: large marketing header scrolls away, compact progress remains. */
  #sellModal .wizard-modal{min-height:100dvh;max-height:100dvh;overflow-y:auto!important;overflow-x:clip;padding-bottom:82px!important}
  #sellModal .wizard-head{display:block;margin:0 0 .5rem;padding-right:2.8rem}
  #sellModal .wizard-head .wizard-step-count{display:none}
  #sellModal .wizard-progress{position:sticky;top:0;z-index:7;margin:.25rem -.15rem .8rem;background:var(--panel-2);box-shadow:0 8px 18px rgba(0,0,0,.16)}
  .wizard-mobile-status{position:sticky;top:10px;z-index:8;display:flex;justify-content:flex-end;pointer-events:none;margin:-.4rem 0 .25rem}
  .wizard-mobile-status span{display:inline-flex;align-items:center;min-height:32px;padding:.3rem .65rem;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--panel) 94%,transparent);backdrop-filter:blur(12px);font-size:.75rem;font-weight:900;color:var(--text)}
  #sellModal .wizard-step{max-height:none!important;overflow:visible!important;padding:.25rem 0 1rem}
  #sellModal .wizard-actions{bottom:0!important;grid-template-columns:1fr 1fr!important;padding:.55rem .65rem calc(.55rem + env(safe-area-inset-bottom))!important;min-height:66px}
  #sellModal .wizard-actions [data-wizard-prev],#sellModal .wizard-actions [data-cancel-listing]{grid-column:auto}
  #sellModal .wizard-actions [data-wizard-next],#sellModal .wizard-actions [data-wizard-submit]{grid-column:2}
  #sellModal .wizard-actions button{min-height:48px}

  /* Tables and desktop split views become cards/vertical flows instead of stretching the page. */
  .liquidation-table-wrap{overflow-x:auto;max-width:100%;overscroll-behavior-x:contain}
  .liquidation-table{min-width:760px}
  .standing-event{grid-template-columns:44px minmax(0,1fr)!important}.standing-event time{grid-column:2}
  .dashboard-item{width:100%;min-width:0}.dashboard-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .conversation-header-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.conversation-header-actions button{width:100%;min-width:0}
  .public-storefront-info-grid,.storefront-listing-grid{max-width:100%}

  /* Safe content spacing for the two mobile docks used inside Profile. */
  #profileModal .modal-mobile-dock{display:grid}
  #profileModal .profile-modal{padding-bottom:calc(140px + var(--mobile-dock-height,72px) + env(safe-area-inset-bottom))}
}

@media(max-width:390px){
  .card-actions{grid-template-columns:1fr 1fr}
  .profile-mobile-nav button{font-size:.61rem}
  .public-storefront-cover{height:155px!important}
}

@media(max-width:340px){
  .toolbar-controls{grid-template-columns:1fr!important}
  .toolbar-controls #sortSelect{grid-column:auto}
  .profile-mobile-nav button{font-size:.58rem}
}
