:root{--bt-theme-transition:background-color .22s ease,color .22s ease,border-color .22s ease,box-shadow .22s ease}
html[data-theme="dark"]{color-scheme:dark;--bg:#0f1218;--bg-2:#0b0e13;--surface:#191d25;--surface-2:#202630;--surface-3:#29313d;--text:#f5f7fb;--text-2:#d5dae4;--text-3:#a5afbd;--border:#303947;--border-2:#3d4858;--ink:#f5f7fb;--muted:#a9b2c0;--line:#303947;--soft:#10151c;--white:#191d25;--shadow:0 5px 18px rgba(0,0,0,.26)}
body,.site-head,.topstrip,.head,.info-head,.info-foot,.card,.sheet,.modal,.drawer,.header-pref-menu,.bt-assistant__panel,.bt-assistant__palette-menu,input,select,textarea,button{transition:var(--bt-theme-transition)}
html[data-theme="dark"] body{background:var(--bg)!important;color:var(--text)!important}
html[data-theme="dark"] :is(.site-head,.topstrip,.head,.info-head,.card,.sheet,.modal,.drawer,.header-pref-menu,.bt-assistant__panel,.bt-assistant__palette-menu,.box,.dd,.pop,.mega,.cat-box,.pcard,.chain-node){background-color:var(--surface)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-theme="dark"] :is(input,select,textarea,.input,.search input,.pref-option,.bt-assistant__action,.btn:not(.btn-primary):not(.primary):not(.btn-red):not(.btn-auth)){background-color:var(--surface-2)!important;color:var(--text)!important;border-color:var(--border-2)!important}
html[data-theme="dark"] :is(.hint,.muted,.sb,.bt-assistant__note,.info-copy,.info-copy p,.crumb,.meta,.spec small){color:var(--text-3)!important}
html[data-theme="dark"] ::placeholder{color:#8e99a9!important;opacity:1}
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,strong,b,label,summary,.title){color:inherit}
html[data-theme="dark"] :is(.mobile-bottom-nav,.filters,.filter-panel,.filter-drawer,.sort-menu,.pagination,.table-wrap,.toolbar,.tabs,.stat,.stat-card,.empty-state,.notification,.conversation,.message-compose){background-color:var(--surface)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-theme="dark"] :is(.chip,.tag,.badge,.status,.spec,.masked,.swap-side,.rolecard,.acheck,.back-r,.otp input,.rate-bar,.deal-step){border-color:var(--border)!important}
html[data-theme="dark"] :is(.mobile-bottom-nav a,.mobile-bottom-nav button){color:var(--text-3)}
html[data-theme="dark"] .mobile-bottom-nav .mobile-create i{border-color:var(--surface)}
html[data-theme="dark"] :is(table,thead,tbody,tr,th,td){border-color:var(--border)!important}
html[data-theme="dark"] :is(th,thead){background-color:var(--surface-2)!important;color:var(--text-2)!important}
html[data-theme="dark"] :is(option){background:var(--surface-2);color:var(--text)}
html[data-theme="dark"] .bt-assistant__message{background:var(--brand-soft);color:var(--text)}
html[data-theme="dark"] .bt-assistant__palette-toggle{background:var(--surface);border-color:var(--border-2)}
html[data-theme="dark"] .header-pref-trigger{background:var(--surface);color:var(--text);border-color:var(--border-2)}
html[data-theme="dark"] .gallery .hero{background:#11161e}
html[data-theme="dark"] img{color-scheme:normal}
html[data-theme="dark"] :is(.info-card,.step,details,.contact-action,.legal-card,.official-links a){background:var(--surface)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-theme="dark"] :is(.info-card p,.step p,details p,.contact-action small,.legal-card p,.legal-card ul,.legal-meta){color:var(--text-3)!important}
html[data-theme="dark"] :is(.info-card .tag,.info-head nav a.is-current,.info-head nav a.on,.empty-note,.step b:first-child,.contact-action i){background:var(--brand-soft)!important;color:var(--brand)!important}
html[data-theme="dark"] .legal-callout{background:rgba(var(--brand-rgb),.13)!important;border-color:rgba(var(--brand-rgb),.35)!important;color:var(--text-2)!important}
html[data-theme="dark"] :is(.info-hero p,.side p,.foot p,.info-foot p){color:#d7dbe3!important}
html[data-theme="dark"] .info-foot{background:#090c11!important;color:#c8ccd4!important}
html[data-theme="dark"] .auth .acard{background:rgba(25,29,37,.97)!important;color:var(--text)!important;border-color:rgba(255,255,255,.13)!important;box-shadow:0 24px 70px rgba(0,0,0,.45)}
html[data-theme="dark"] .auth :is(.ainput input,.gbtn,.wabtn,.rolecard,.rolecard .ri2,.acheck,.acheck i,.otp input,.back-r){background:var(--surface-2)!important;color:var(--text)!important;border-color:var(--border-2)!important}
html[data-theme="dark"] .auth :is(.ainput input:focus,.rolecard:hover){background:var(--surface-3)!important;border-color:var(--brand)!important}
html[data-theme="dark"] .auth .btn-auth.off{background:#2a303b!important;color:#8993a3!important}
html[data-theme="dark"] .auth .overlay>div{background:var(--surface)!important;color:var(--text)!important;border:1px solid var(--border)!important}
html[data-theme="dark"] .auth .art-cards .ac{background:linear-gradient(145deg,rgba(255,255,255,.17),rgba(255,255,255,.075))!important}
html[data-theme="dark"] .hero{background:#11161e!important}
html[data-theme="dark"] :is(.spec,.layout .side){background:var(--surface-2)!important}
html[data-theme="dark"] .notice{background:#302713!important;border-color:#5c4821!important}
html[data-theme="dark"] .notice :is(b,p){color:#f2cf78!important}
html[data-theme="dark"] .topstrip a{color:var(--text-2)}
html[data-theme="dark"] .topstrip a:hover{color:#fff}
html[data-theme="dark"] .hero-search{background:rgba(25,29,37,.96)!important;border-color:var(--border-2)!important;box-shadow:0 18px 42px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.035)}
html[data-theme="dark"] .hero-search input{background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--border)!important;border-radius:12px}
html[data-theme="dark"] .hero-search input:focus{border-color:var(--brand)!important;box-shadow:0 0 0 3px var(--brand-soft)!important;background:var(--surface-3)!important}
html[data-theme="dark"] .hero-search .hero-swap-mini{background:var(--brand-soft)!important;color:var(--brand)!important;box-shadow:inset 0 0 0 1px rgba(var(--brand-rgb),.2)}
.bt-theme-choice{min-height:38px;border:1px solid var(--border,#e5e7eb);border-radius:10px;background:var(--surface,#fff);color:var(--text,#222);font:600 11px/1 Poppins,Arial,sans-serif;display:flex;align-items:center;justify-content:center;gap:7px;cursor:pointer}
.bt-theme-choice:hover,.bt-theme-choice.is-active{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
.bt-theme-choice:focus-visible{outline:3px solid var(--brand-soft);outline-offset:2px}
@media(prefers-reduced-motion:reduce){body,.site-head,.topstrip,.head,.info-head,.info-foot,.card,.sheet,.modal,.drawer,.header-pref-menu,.bt-assistant__panel,.bt-assistant__palette-menu,input,select,textarea,button{transition:none!important}}

/* ========================================================================== 
   BARTERTAP UI REFINEMENT — LOCAL STAGING LAYER
   This layer consolidates shared visual rules without replacing page identity.
   ========================================================================== */
:root{
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;
  --space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;
  --radius-control:12px;--radius-card:18px;--radius-dialog:24px;
  --control-sm:40px;--control-md:44px;--control-lg:50px;
  --focus-ring:0 0 0 3px var(--brand-soft);
  --elevation-card:0 1px 2px rgba(16,24,40,.04),0 8px 24px rgba(16,24,40,.05);
  --elevation-float:0 18px 42px rgba(16,24,40,.16)
}

:where(a,button,input,select,textarea,summary,[role="button"]):focus-visible{
  outline:2px solid var(--brand,#0f756f)!important;outline-offset:2px!important
}
:where(button,.btn,.primary,.btn-primary,.info-create,.public-auth-btn):disabled,
:where(button,.btn,.primary,.btn-primary,.info-create,.public-auth-btn)[aria-disabled="true"]{
  cursor:not-allowed!important;opacity:.55!important;box-shadow:none!important;transform:none!important
}
:where(input,select,textarea,.input){border-radius:var(--radius-control)}
:where(.card,.info-card,.contact-action,.step,details){box-shadow:var(--elevation-card)}
:where(.btn,.primary,.btn-primary,.info-create){min-height:var(--control-sm)}
:where(.icon-btn,.round-action,.bt-create-close,.bt-create-back){flex:0 0 auto}
.ui-icon{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.round-action.is-active,#fav-secondary.is-active{border-color:var(--brand)!important;background:var(--brand-soft)!important;color:var(--brand)!important}

/* Information and legal pages: replace the clipped mobile scroller with an
   explicit accessible menu. */
.info-menu-toggle{display:none;min-height:42px;padding:0 12px;border:1px solid var(--line,var(--border));border-radius:12px;background:var(--surface,#fff);color:var(--ink,var(--text));align-items:center;justify-content:center;gap:7px;font:600 12px/1 Poppins,sans-serif;cursor:pointer}
.info-menu-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
@media(max-width:820px){
  .info-head{height:auto!important;min-height:64px!important;padding:10px 14px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px 12px!important;align-items:center!important}
  .info-head .bt-logo{justify-self:start!important;min-height:42px!important;font-size:14px!important}
  .info-menu-toggle{display:inline-flex}
  .info-head nav{grid-column:1/-1;margin:0!important;width:100%!important;display:none!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important;overflow:visible!important;padding:4px 0 2px!important}
  .info-head.is-menu-open nav{display:grid!important}
  .info-head nav a,.info-head nav a:not(.info-create){display:flex!important;width:100%;min-height:42px;align-items:center;justify-content:flex-start;white-space:normal!important;padding:9px 11px!important;border:1px solid var(--line,var(--border));border-radius:11px;background:var(--surface,#fff)}
  .info-head nav .info-create{justify-content:center!important;border-color:var(--brand)!important;background:var(--brand)!important;color:#fff!important}
}
@media(max-width:390px){.info-head nav{grid-template-columns:1fr}}

/* Listing detail: content intent must be understood before the gallery on
   narrow screens; related cards remain last. */
@media(max-width:920px){
  .layout>.top-meta{order:0}.layout>.right-col{order:1}.layout>.left-col{order:2}.layout>.related{order:3}
  .right-col>.info{order:1}.right-col>.seller-card{order:2}
  .layout>.right-col{gap:12px}
}
@media(max-width:600px){
  .top-meta .meta-actions{display:flex;gap:8px}
  .top-meta .round-action{width:42px;height:42px}
  .exchange-side{min-height:64px}
  .seller .avatar{width:44px;height:44px}
  .related-head{align-items:flex-start;gap:10px}.related-head .btn{flex:0 0 auto}
}

/* Account/dashboard density and overflow. */
#v-dash>.page>.grid.g4{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important}
.page-head{align-items:flex-start}
.page-head .page-actions{flex-wrap:wrap}
.tabs,.customer-profile-tabs{scrollbar-width:thin;overscroll-behavior-x:contain}
.dashboard-listing-title,.dashboard-listing-side strong{min-width:0}
@media(min-width:1181px){
  #v-dash>.page>.grid.g4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  #v-listings .tabs{flex-wrap:wrap;overflow:visible}
}
@media(max-width:640px){
  #v-dash>.page>.grid.g4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dashboard-listing-card{align-items:start}
  .dashboard-listing-menu .btn{min-height:44px}
}
@media(max-width:360px){#v-dash>.page>.grid.g4{grid-template-columns:1fr!important}}

/* Floating helpers must not cover primary content or the mobile bottom nav. */
@media(max-width:640px){
  .bt-assistant{right:12px!important;bottom:calc(76px + env(safe-area-inset-bottom))!important}
  .bt-assistant__palette{display:none!important}
  .bt-assistant__toggle{width:48px!important;height:48px!important;border-radius:15px!important}
  body:has(.form-foot) .bt-assistant{bottom:calc(92px + env(safe-area-inset-bottom))!important}
  body:not(:has(.mobile-bottom-nav)) .bt-assistant{bottom:calc(16px + env(safe-area-inset-bottom))!important}
  body:has(.form-foot):not(:has(.mobile-bottom-nav)) .bt-assistant{bottom:calc(16px + env(safe-area-inset-bottom))!important}
  body.by-form-actions-visible:has(.form-foot):not(:has(.mobile-bottom-nav)) .bt-assistant{bottom:calc(172px + env(safe-area-inset-bottom))!important}
}

/* Responsive safety rails shared by the public experience. */
img,video{max-width:100%}
:where(.wrap,.page,.info-main,.info-hero>div){min-width:0}
@media(max-width:640px){
  :where(button,.btn,a.info-create,.icon-btn,summary,[role="button"]){-webkit-tap-highlight-color:transparent}
  :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* Shared shell alignment: page content, legal layouts and listing detail use
   the same 1280/22 rhythm as the universal header and footer. */
.info-hero>div,.info-main{width:100%;max-width:calc(var(--bt-shell-max,1280px) - (var(--bt-shell-gutter,22px) * 2))}
body>main.wrap:has(>#app){width:100%;max-width:var(--bt-shell-max,1280px);padding-inline:var(--bt-shell-gutter,22px)}
:where(.page-head,.card-head,.related-head,.sec-title)>:where(h1,h2,h3),
:where(.card,.sheet,.modal,.info-card,.legal-card) :where(h1,h2,h3,h4){overflow-wrap:anywhere}
@media(max-width:760px){
  .info-hero>div,.info-main{max-width:none}
  body>main.wrap:has(>#app){padding-inline:var(--bt-shell-gutter,14px)}
}

/* Authentication controls keep a real touch target while the icon remains
   visually compact. */
.auth .ainput .ri{right:6px;width:40px;height:40px;padding:0;display:grid;place-items:center;border-radius:10px}
.auth .ainput .ri:hover{background:var(--brand-soft,#e8f4f1);color:var(--brand,#0f927e)}
.auth .alink[role="button"]{min-height:36px;display:inline-flex;align-items:center}
