/* VendiGG Final Polish v7.0 — consistency, accessibility and interaction polish only */

/* ---------- interaction system ---------- */
:root{
  --v7-focus:#ff5264;
  --v7-danger:#dc3545;
  --v7-success:#1b9b68;
}

body :where(a,button,summary,input,select,textarea){-webkit-tap-highlight-color:transparent}
body :where(a,button,summary){text-underline-offset:2px}
body :where(button,.btn,[role="button"]):disabled,
body :where(button,.btn,[role="button"])[aria-disabled="true"]{cursor:not-allowed!important;opacity:.58;box-shadow:none!important;transform:none!important}
body :where(.btn,button)[aria-busy="true"]{position:relative;pointer-events:none;cursor:progress!important}
body :where(.btn,button).is-loading{filter:saturate(.72)}
body :where(.btn,button).is-loading::after{content:"";width:13px;height:13px;margin-left:7px;display:inline-block;vertical-align:-2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:v7spin .72s linear infinite}
@keyframes v7spin{to{transform:rotate(360deg)}}

/* Keep keyboard navigation highly visible without changing mouse/touch visuals. */
body :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:3px solid color-mix(in srgb,var(--v7-focus) 78%,white)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--v7-focus) 24%,transparent)!important;
}

/* ---------- form clarity ---------- */
body :where(.input,.select,.textarea,input,select,textarea)[aria-invalid="true"],
body :where(.input,.select,.textarea,input,select,textarea).v7-invalid{
  border-color:color-mix(in srgb,var(--v7-danger) 78%,transparent)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--v7-danger) 12%,transparent)!important;
}
body :where(.field,.buyer-field,.seller-field,.admin-field).v7-field-invalid :where(label,.label){color:var(--v7-danger)!important}
body textarea{resize:vertical}
body input::placeholder,body textarea::placeholder{opacity:.72}
body :where(.field-hint,.help-text,.form-hint,small){overflow-wrap:anywhere}

/* ---------- text/content safety ---------- */
body :where(.buyer-chat-message,.seller-message,.message-body,.buyer-delivery-content,.seller-delivery-box,.description,.product-description,.store-description,.notice,.flash){overflow-wrap:anywhere;word-break:break-word}
body :where(pre,code){white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
body :where(.table-wrap,.seller-report-table,.admin-table-wrap){scrollbar-gutter:stable;overscroll-behavior-inline:contain}

/* ---------- dropdowns / details ---------- */
body details>summary{user-select:none}
body details>summary::marker{font-size:.8em}
.workspace-account-panel,.admin-account-panel,.account-menu-panel{
  max-height:min(72vh,560px);overflow:auto;overscroll-behavior:contain;
}
.workspace-account-menu[open]>summary,.admin-account-menu[open]>summary,.account-menu[open]>summary{
  border-color:color-mix(in srgb,var(--v7-focus) 34%,currentColor)!important;
}

/* ---------- empty states / notices ---------- */
body :where(.empty,.premium-empty,.vd-empty-state,.store-v25-empty,.catalog-v26-empty,.seller-catalog-empty,.admin-v31-empty,.admin-v32-empty,.marketing-empty){
  overflow:hidden;overflow-wrap:anywhere;
}
body :where(.empty,.premium-empty,.vd-empty-state,.store-v25-empty,.catalog-v26-empty,.seller-catalog-empty,.admin-v31-empty,.admin-v32-empty,.marketing-empty) :where(h2,h3,b,strong){text-wrap:balance}
body :where(.notice,.flash){line-height:1.5}

/* ---------- navigation polish ---------- */
.private-mobile-nav>a[aria-current="page"],.mobile-commerce-nav>a[aria-current="page"]{isolation:isolate}
.private-mobile-nav>a[aria-current="page"]::after,.mobile-commerce-nav>a[aria-current="page"]::after{
  content:"";position:absolute;inset:auto 24% 1px;height:2px;border-radius:999px;background:currentColor;opacity:.28;pointer-events:none;
}
.admin-sidebar-v2 a[aria-current="page"],.seller-side-nav a[aria-current="page"],.buyer-side-nav a[aria-current="page"]{font-weight:850!important}

/* ---------- toasts ---------- */
.rm-toast{max-width:min(420px,calc(100vw - 24px));overflow-wrap:anywhere;line-height:1.4}
.rm-toast[data-type="error"]{border-color:color-mix(in srgb,var(--v7-danger) 34%,transparent)!important}

/* ---------- mobile final pass ---------- */
@media(max-width:820px){
  body :where(.workspace-account-panel,.admin-account-panel){position:fixed!important;left:10px!important;right:10px!important;top:auto!important;bottom:calc(78px + env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;max-height:min(68dvh,520px)!important}
  body :where(.btn,button,a)[data-v7-touch],body .private-mobile-nav>a,body .private-mobile-nav>button{touch-action:manipulation}
  body :where(.buyer-page-head,.seller-page-head,.admin-page-head) h1{text-wrap:balance}
  body :where(.buyer-page-head,.seller-page-head,.admin-page-head) p{max-width:62ch}
  .rm-toast{left:12px;right:12px;width:auto;max-width:none}
}

@media(max-width:430px){
  body :where(.workspace-account-panel,.admin-account-panel){left:7px!important;right:7px!important}
  .private-mobile-nav>a b,.private-mobile-nav>button b{letter-spacing:0!important}
}

@media(prefers-reduced-motion:reduce){
  body :where(.btn,button).is-loading::after{animation-duration:1.5s}
}
