/* Vetra 0.3.1.37a - Main Marketplace Visual Stabilization MV1A
   Additive presentation correction over approved MV1. Existing application hooks and authority remain unchanged. */

/* --- Header containment + Marketplace search placement --- */
.topbar{
  grid-template-columns:auto minmax(0,1fr)!important;
  gap:.75rem!important;
  max-width:100vw;
  overflow:visible;
}
.topbar>.brand{min-width:0}
.top-actions{
  min-width:0;
  max-width:100%;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:.38rem;
}
.top-actions .ghost-btn,.top-actions .icon-btn,.top-actions .primary-btn{
  flex:0 0 auto;
  min-height:38px;
  padding:.52rem .7rem;
  font-size:.74rem;
  white-space:nowrap;
}
.mobile-header-menu{display:none;position:relative;min-width:0}
.mobile-header-menu>summary{
  list-style:none;display:grid;place-items:center;width:42px;height:42px;padding:0;
  border:1px solid var(--line);border-radius:12px;background:var(--panel-2);color:var(--text);
  font-size:1.2rem;font-weight:900;cursor:pointer;user-select:none;
}
.mobile-header-menu>summary::-webkit-details-marker{display:none}
.mobile-header-menu[open]>summary{border-color:rgba(69,161,255,.56);box-shadow:0 0 0 3px rgba(47,139,255,.09)}
.mobile-header-menu-panel{
  position:absolute;right:0;top:calc(100% + 8px);z-index:150;width:min(290px,calc(100vw - 18px));
  display:grid;gap:6px;padding:9px;border:1px solid rgba(75,154,244,.30);border-radius:14px;
  background:linear-gradient(180deg,rgba(7,24,44,.99),rgba(2,13,27,.995));
  box-shadow:0 22px 60px rgba(0,0,0,.48),0 0 32px rgba(23,113,238,.10);
}
.mobile-header-menu-panel button{width:100%;min-width:0;min-height:42px;text-align:left;justify-content:flex-start;white-space:normal}

.market-search-dock{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.7rem;align-items:center;
  padding:.68rem .78rem;border-radius:15px;
  background:linear-gradient(180deg,rgba(7,25,47,.90),rgba(3,16,31,.94));
  border:1px solid rgba(73,149,237,.22);box-shadow:inset 0 1px rgba(255,255,255,.025);
}
.market-search-dock .search-panel{min-width:0;width:100%;margin:0}
.market-search-dock .search-panel input{min-width:0;width:100%}
.market-search-dock #favoritesButton{min-height:43px;white-space:nowrap}

/* --- Filters: fully hidden when closed + readable tab orientation --- */
.premium-filter-drawer{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  box-shadow:none!important;
  transition:transform .22s ease,opacity .16s ease,visibility 0s linear .22s,box-shadow .22s ease!important;
}
.premium-filter-drawer.desktop-open,.premium-filter-drawer.mobile-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:transform .22s ease,opacity .16s ease,visibility 0s linear 0s,box-shadow .22s ease!important;
  box-shadow:0 25px 80px rgba(0,0,0,.55),0 0 40px rgba(23,107,230,.10)!important;
}
.market-filter-edge-tab{
  writing-mode:vertical-rl!important;
  rotate:0deg!important;
  transform:translateY(-50%)!important;
  direction:ltr;
}

/* --- Listing Detail desktop containment and cleaner seller action --- */
.detail-modal{
  scrollbar-gutter:stable both-edges;
  overflow-x:hidden!important;
  scrollbar-width:thin;
  scrollbar-color:rgba(75,157,244,.48) rgba(2,12,25,.25);
}
.detail-modal::-webkit-scrollbar{width:11px}
.detail-modal::-webkit-scrollbar-track{background:rgba(2,12,25,.28);border-radius:999px}
.detail-modal::-webkit-scrollbar-thumb{background:rgba(75,157,244,.42);border:2px solid rgba(2,12,25,.72);border-radius:999px}
.detail-seller-card>.ghost-btn{
  align-self:center!important;
  width:auto!important;
  min-width:0;
  max-width:196px;
  min-height:42px;
  padding:.58rem .78rem;
  white-space:normal;
  text-align:center;
}
.vetra-related-right{transform:translateX(-14px)!important}

/* --- Intentional status colors --- */
.sold-history-row{
  border-color:rgba(255,91,112,.54)!important;
  background:linear-gradient(145deg,rgba(91,18,32,.30),rgba(36,9,17,.20))!important;
  box-shadow:inset 3px 0 0 rgba(255,91,112,.76);
}
.sold-history-row .moderation-badge{
  color:#ffdce2!important;
  border-color:rgba(255,91,112,.58)!important;
  background:rgba(255,91,112,.18)!important;
}
.trust-insight-user.trust-observe{
  border-color:rgba(255,99,113,.42)!important;
  background:linear-gradient(145deg,rgba(113,25,37,.22),rgba(55,12,22,.15))!important;
}
.trust-insight-user.trust-review{
  border-color:rgba(255,70,91,.62)!important;
  background:linear-gradient(145deg,rgba(135,18,35,.30),rgba(65,8,18,.20))!important;
  box-shadow:inset 3px 0 0 rgba(255,70,91,.72);
}

/* --- Deliberate light theme: light working surfaces, dark Vetra brand anchors --- */
html.light body{
  background:
    radial-gradient(circle at 50% -12%,rgba(22,123,245,.12),transparent 33rem),
    linear-gradient(180deg,#f4f7fb 0%,#eef3f8 48%,#eaf0f6 100%)!important;
  color:var(--text);
}
html.light body::before{
  background:linear-gradient(90deg,rgba(23,105,205,.035) 1px,transparent 1px),linear-gradient(rgba(23,105,205,.028) 1px,transparent 1px)!important;
}
/* Brand chrome intentionally remains dark so Vetra artwork looks integrated instead of boxed. */
html.light .topbar{
  background:rgba(3,13,27,.97)!important;
  border-bottom-color:rgba(76,155,255,.30)!important;
  color:#f5f8fc;
}
html.light .topbar .ghost-btn,html.light .topbar .icon-btn{
  background:rgba(9,29,51,.90)!important;color:#eaf4ff!important;border-color:rgba(88,161,240,.25)!important;
}
html.light .topbar .primary-btn{color:#fff!important}
html.light .topbar .mobile-header-account,html.light .topbar .mobile-header-menu>summary{
  background:rgba(9,29,51,.94)!important;color:#eaf4ff!important;border-color:rgba(88,161,240,.28)!important;
}
html.light .mobile-header-menu-panel{background:linear-gradient(180deg,#0a2139,#041426)!important}
html.light .category-strip-wrap{background:rgba(248,251,255,.97)!important;border-color:rgba(23,76,130,.14)!important}
html.light .category-strip button{background:#fff!important;color:#213348!important;border-color:rgba(30,91,151,.15)!important}
html.light .category-strip button.active{background:linear-gradient(100deg,#0a73df,#43a8ff)!important;color:#fff!important;border-color:#258fe9!important}

html.light .hero.card{
  background:radial-gradient(circle at 36% 34%,rgba(18,111,242,.20),transparent 25rem),linear-gradient(135deg,#031021,#071d39 58%,#03101f)!important;
  color:#f6f9ff!important;border-color:rgba(65,145,239,.35)!important;
}
html.light .hero.card .hero-copy,html.light .hero.card .hero-panel-label{color:#a9bdd2!important}
html.light .hero.card .eyebrow{color:#74c8ff!important}
html.light .hero-panel{background:linear-gradient(160deg,rgba(8,32,61,.90),rgba(3,16,31,.94))!important;border-color:rgba(63,148,247,.28)!important;color:#f6f9ff!important}
html.light .hero-stat-grid button{background:rgba(5,20,38,.78)!important;color:#f6f9ff!important;border-color:rgba(77,151,235,.22)!important}
html.light .hero-stat-grid button span{color:#a9bdd2!important}

html.light .market-search-dock{
  background:linear-gradient(180deg,#ffffff,#f4f8fc)!important;
  border-color:rgba(31,92,155,.17)!important;
  box-shadow:0 10px 30px rgba(32,63,96,.08)!important;
}
html.light .market-search-dock .search-panel{background:#f8fbff!important;border-color:rgba(32,94,157,.20)!important}
html.light .market-search-dock .search-panel input{color:#14243a!important}
html.light .market-search-dock .search-panel button{color:#11365f!important;background:rgba(26,124,226,.10)!important}
html.light .market-search-dock #favoritesButton{background:#fff!important;color:#19324e!important;border-color:rgba(31,92,155,.18)!important}

html.light .premium-filter-drawer{
  background:linear-gradient(180deg,#ffffff,#f2f7fc)!important;
  color:#18283d!important;border-color:rgba(30,99,167,.23)!important;
}
html.light .premium-filter-drawer .filter-block,html.light .premium-filter-drawer .sidebar-quick-card,html.light .premium-filter-drawer .seller-callout{border-color:rgba(30,92,153,.15)!important}
html.light .premium-filter-drawer input,html.light .premium-filter-drawer select{background:#fff!important;color:#17273c!important;border-color:rgba(32,87,143,.18)!important}
html.light .premium-filter-drawer .ghost-btn,html.light .premium-filter-drawer .text-btn{color:#24425f!important}
html.light .market-filter-edge-tab{color:#f4f9ff!important}

html.light .card,html.light .item-card,
html.light .detail-summary-card,html.light .detail-content-card,html.light .detail-media-column,
html.light .modal-card,html.light .public-storefront-info-grid article,html.light .storefront-trust-summary article,
html.light .storefront-trust-stat-button,html.light .listing-capabilities-section,html.light .listing-transaction-panel,
html.light .listing-external-links,html.light .vetra-related-card{
  background:linear-gradient(180deg,#ffffff,#f4f8fc)!important;
  color:#111f32!important;
  border-color:rgba(29,87,145,.17)!important;
  box-shadow:0 12px 34px rgba(31,62,95,.08)!important;
}
html.light .item-body{background:linear-gradient(180deg,#ffffff,#f7faff)!important;color:#111f32!important}
html.light .item-title,html.light .card strong,html.light .detail-summary-card h2,html.light .detail-content-card h3{color:#102238!important}
html.light .muted,html.light .item-meta,html.light .detail-seller-copy span,html.light .detail-seller-copy small{color:#607287!important}
html.light .image-stage,html.light .detail-seller-avatar{background:#e8eef5!important}
html.light .ghost-btn{background:#fff;color:#1b3857;border-color:rgba(31,92,155,.20)}
html.light .ghost-btn:hover{background:#edf5fd;border-color:rgba(25,116,207,.36)}
html.light input,html.light select,html.light textarea{background:#fff;color:#15263b;border-color:rgba(28,83,139,.19)}

html.light .detail-modal{background:linear-gradient(180deg,#f7faff,#edf3f9)!important;color:#13243a!important}
html.light .detail-seller-card{background:linear-gradient(145deg,#f7fbff,#edf4fb)!important;border-color:rgba(34,102,171,.20)!important}
html.light .detail-card-label{color:#176fc3!important}
html.light .detail-offer-state.asking-only{color:#24527f!important}
html.light .detail-auctions-soon{color:#006f9e!important;background:rgba(0,136,196,.08)!important}
html.light #modalContent>.listing-capabilities-section,html.light #modalContent>.listing-transaction-panel,html.light #modalContent>.listing-external-links{background:linear-gradient(180deg,#fff,#f3f7fb)!important}
html.light .modal::backdrop{background:rgba(22,35,51,.54)!important}
html.light .modal-close{background:#fff!important;color:#17314d!important;border-color:rgba(31,92,155,.22)!important}

html.light .public-storefront,html.light .storefront-public-modal{background:linear-gradient(180deg,#f8fbff,#edf3f8)!important;color:#13243a!important}
html.light .public-storefront-cover{background:#dfe8f2!important}
html.light .public-storefront-avatar{background:#fff!important}
html.light .storefront-listing-card{background:linear-gradient(180deg,#fff,#f4f8fc)!important;color:#13243a!important;border-color:rgba(33,95,157,.17)!important}
html.light .public-storefront-title>p,html.light .public-storefront-info-grid article p,html.light .public-storefront-info-grid article span{color:#5e7085!important}

html.light .vetra-related-copy strong,html.light .vetra-related-copy span{color:#14263c!important}
html.light .vetra-related-copy small,html.light .vetra-related-rail-title{color:#176fc3!important;text-shadow:none!important}
html.light .sold-history-row{background:linear-gradient(145deg,rgba(255,230,234,.96),rgba(255,243,245,.96))!important;color:#5e1621!important}
html.light .trust-insight-user.trust-observe{background:#fff0f2!important;color:#5a1d27!important}
html.light .trust-insight-user.trust-review{background:#ffe7eb!important;color:#58151f!important}

/* Footer remains a dark branded anchor in both themes. */
html.light .premium-site-footer{background:linear-gradient(180deg,#031022,#010812)!important;color:#f5f8fc!important;border-color:rgba(67,148,241,.30)!important}
html.light .premium-footer-column strong{color:#e9f5ff!important}
html.light .premium-footer-column a,html.light .premium-footer-column button,html.light .premium-footer-brand p{color:#9eb0c6!important}
html.light .premium-footer-column a:hover,html.light .premium-footer-column button:hover{color:#59b4ff!important}

@media(max-width:1000px){
  .topbar{
    grid-template-columns:minmax(0,1fr) auto auto auto!important;
    gap:.42rem!important;
    padding:.58rem .65rem!important;
  }
  .top-actions{display:none!important}
  .mobile-header-account{display:inline-flex;align-items:center;justify-content:center;min-width:0;min-height:40px}
  .mobile-header-menu{display:block}
  .premium-filter-drawer{
    opacity:0!important;visibility:hidden!important;pointer-events:none!important;
  }
  .premium-filter-drawer.mobile-open{
    opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  }
  .market-filter-edge-tab{
    writing-mode:horizontal-tb!important;
    rotate:0deg!important;
    transform:none!important;
    direction:ltr!important;
  }
  .detail-seller-card>.ghost-btn{max-width:none;width:100%!important;align-self:stretch!important}
  .vetra-related-right{transform:none!important}
}

@media(max-width:720px){
  .premium-header-logo{width:min(118px,30vw)!important;max-width:118px}
  .mobile-header-notifications{width:40px;height:40px;min-width:40px;padding:0!important}
  .mobile-header-account{max-width:min(105px,26vw)!important;min-width:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-header-menu>summary{width:40px;height:40px}
  .market-search-dock{grid-template-columns:1fr;padding:.55rem;gap:.45rem}
  .market-search-dock #favoritesButton{display:none}
  .market-search-dock .search-panel{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;grid-column:auto!important;order:initial!important;margin:0!important}
  .market-search-dock .search-panel button{grid-column:auto!important;min-width:74px}
  .detail-modal{scrollbar-gutter:auto}
}

@media(max-width:430px){
  .topbar{grid-template-columns:minmax(84px,1fr) 38px minmax(0,82px) 38px!important;padding:.5rem!important;gap:.3rem!important}
  .premium-header-logo{width:min(102px,29vw)!important;max-height:34px!important}
  .mobile-header-notifications{width:38px;height:38px;min-width:38px;font-size:.9rem}
  .mobile-header-account{max-width:82px!important;padding:.3rem .4rem!important;font-size:.7rem}
  .mobile-header-menu>summary{width:38px;height:38px;font-size:1.05rem}
  .mobile-header-menu-panel{right:-2px;width:min(278px,calc(100vw - 12px))}
  .market-search-dock .search-panel{grid-template-columns:auto minmax(0,1fr)!important}
  .market-search-dock .search-panel button{grid-column:1/-1!important;width:100%}
}
