/* TOPINEXUS FINAL THEME HARDENING — V13 re-check
   One source of truth for contrast. Loaded last on every page. */
:root{
  --tn-bg:#0d0917;
  --tn-surface:#19132a;
  --tn-surface-2:#211a36;
  --tn-border:#34284e;
  --tn-text:#f7f3ff;
  --tn-muted:#aaa0c2;
  --tn-faint:#807493;
  --tn-accent:#a78bfa;
  --tn-accent-strong:#8b5cf6;
  --tn-success:#2dd4bf;
  --tn-danger:#ff6680;
  --tn-on-accent:#ffffff;
  color-scheme:dark;
}
html[data-theme="light"]{
  --tn-bg:#f7f5fb;
  --tn-surface:#ffffff;
  --tn-surface-2:#f1ecf8;
  --tn-border:#d9d0e5;
  --tn-text:#211936;
  --tn-muted:#655d72;
  --tn-faint:#7b728a;
  --tn-accent:#7c3aed;
  --tn-accent-strong:#6d28d9;
  --tn-success:#087f6b;
  --tn-danger:#c6284d;
  --tn-on-accent:#ffffff;
  color-scheme:light;
}

html,body{background:var(--tn-bg)!important;color:var(--tn-text)!important;max-width:100%;overflow-x:hidden}
body{margin:0}

/* Normal text: dark on light, white on dark. Do not recolor SVG/image content. */
body :where(h1,h2,h3,h4,h5,h6,p,li,dt,dd,td,th,label,legend,summary,strong,em,small,.title,.name,.label,.value,.description,.subtitle,.sub,.dim,.section-head,.panel-head,.panel-title,.panel-subtitle,.stat-value,.stat-label,.nav-label,.menu-label,.card-name,.card-price,.p-name,.p-price,.p-old,.delivery-title,.delivery-sub,.auth-hint,.payment-title){
  color:var(--tn-text)!important;
  -webkit-text-fill-color:var(--tn-text)!important;
}
body :where(.muted,.text-muted,.text-dim,.text-faint,.inline-note,.secure,.delivery-sub,.auth-hint){
  color:var(--tn-muted)!important;
  -webkit-text-fill-color:var(--tn-muted)!important;
}

/* Intentional semantic/accent colors. */
body :where(.accent,.link-btn,.track-link,.ticket-link,.section-head a,.card-cat,.cat-tag,.discount-tag){
  color:var(--tn-accent)!important;
  -webkit-text-fill-color:var(--tn-accent)!important;
}
body :where(.danger,.error,.err){color:var(--tn-danger)!important;-webkit-text-fill-color:var(--tn-danger)!important}
body :where(.status,.pill){color:inherit}

/* Surfaces and borders. */
body :where(.panel,.card,.box,.modal,.sheet,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.panel-lite,.payment-method-btn,.ticket-item,.ticket-msg,.support-menu,.tn-topnav-menu){
  background:var(--tn-surface)!important;
  border-color:var(--tn-border)!important;
  color:var(--tn-text)!important;
}
body :where(.panel-body,.surface-2,.ticket-chat,.payment-number,.checkout-trust span){
  color:var(--tn-text)!important;
}

/* Inputs and editable controls. */
body :where(input:not([type="color"]),textarea,select,[contenteditable="true"]){
  box-sizing:border-box!important;
  width:100%;
  max-width:100%;
  min-width:0;
  background:var(--tn-surface)!important;
  color:var(--tn-text)!important;
  -webkit-text-fill-color:var(--tn-text)!important;
  border-color:var(--tn-border)!important;
  caret-color:var(--tn-text)!important;
}
body :where(input,textarea)::placeholder{color:var(--tn-muted)!important;-webkit-text-fill-color:var(--tn-muted)!important;opacity:1!important}
body option{background:var(--tn-surface)!important;color:var(--tn-text)!important}

/* Buttons: predictable variants, never inherit the wrong theme color. */
body :where(.btn,button.btn,a.btn){
  box-sizing:border-box!important;
  max-width:100%;
  min-width:0;
  overflow-wrap:anywhere;
  white-space:normal;
  color:var(--tn-on-accent)!important;
  -webkit-text-fill-color:var(--tn-on-accent)!important;
  border-color:var(--tn-accent-strong)!important;
  background:var(--tn-accent-strong)!important;
}
body :where(.btn.secondary,.btn.ghost,.btn.mini,.btn.sm.secondary,.icon-btn,.notice-btn,.tab-btn,.theme-toggle,.tn-global-theme-toggle,.password-toggle){
  background:var(--tn-surface-2)!important;
  color:var(--tn-text)!important;
  -webkit-text-fill-color:var(--tn-text)!important;
  border-color:var(--tn-border)!important;
}
body :where(.btn.danger){background:var(--tn-danger)!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:var(--tn-danger)!important}
body :where(.btn.primary,.btn-accent){background:var(--tn-accent-strong)!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:var(--tn-accent-strong)!important}

/* Theme switch itself. */
body :where(.theme-toggle,.tn-global-theme-toggle){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;
  max-width:100%;min-width:0;padding:0 12px!important;min-height:40px;height:40px!important;
  border:1px solid var(--tn-border)!important;border-radius:12px!important;
  background:var(--tn-surface-2)!important;color:var(--tn-text)!important;
  -webkit-text-fill-color:var(--tn-text)!important;font-weight:800!important;
  box-shadow:0 6px 18px rgba(0,0,0,.10)!important;
}
body :where(.theme-icon,.tn-theme-icon,.theme-label,.tn-theme-label){color:var(--tn-text)!important;-webkit-text-fill-color:var(--tn-text)!important}

/* Navigation/menu. */
body :where(.menu-list a,.menu-list button,.tn-topnav-menu a,#side-nav a,.sidebar nav a,.nav-item){
  color:var(--tn-text)!important;-webkit-text-fill-color:var(--tn-text)!important;
}
body :where(.menu-list a:hover,.menu-list button:hover,.tn-topnav-menu a:hover){background:var(--tn-surface-2)!important}

/* Intentional white text on colored/image surfaces stays white in both themes. */
body :where(.slide-overlay,.hero-overlay,.image-overlay,.cat-chip,.support-main,.btn.primary,.btn-accent,.btn.danger) :where(h1,h2,h3,h4,h5,h6,p,span,a,strong,small){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
body :where(.slide-overlay,.hero-overlay,.image-overlay,.cat-chip){color:#fff!important}

/* Cards/panels must contain their content. */
body :where(.panel,.card,.box,.modal,.sheet,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.panel-lite,.ticket-item,.ticket-msg){
  min-width:0;max-width:100%;overflow:hidden;
}
body :where(.panel-head,.panel-header,.section-head,.form-actions,.actions,.toolbar,.upload-row,.order-actions,.delivery-actions,.payment-admin-actions,.media-actions,.ticket-actions,.payment-method-row){
  min-width:0;max-width:100%;display:flex;flex-wrap:wrap;align-items:center;gap:8px;
}
body :where(.panel-head > *, .panel-header > *, .section-head > *, .form-actions > *, .actions > *, .toolbar > *, .upload-row > *, .order-actions > *, .delivery-actions > *, .payment-admin-actions > *, .media-actions > *, .ticket-actions > *){min-width:0;max-width:100%}
body :where(.panel-head h1,.panel-head h2,.panel-head h3,.panel-head h4,.section-head h1,.section-head h2,.section-head h3,.section-head h4){overflow-wrap:anywhere;word-break:normal}

/* Tables, long product/category names and data values. */
body :where(.table-wrap){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
body :where(td,th,.card-name,.p-name,.description,.delivery-secret,.ticket-msg,.ticket-item){overflow-wrap:anywhere;word-break:break-word}
body :where(.btn.block){width:100%;display:flex;align-items:center;justify-content:center;text-align:center}

/* Form rows: controls never force the parent wider. */
body :where(.field,.field > *, .grid2 > *, .upload-row > *, .payment-method-grid > *, .form-actions > *){min-width:0;max-width:100%}
body :where(.upload-row){align-items:stretch}
body :where(.upload-row input){flex:1 1 180px}
body :where(.upload-row .btn){flex:0 1 auto}

/* Mobile: no compressed overflow; actions stack cleanly. */
@media(max-width:700px){
  body :where(.panel-head,.section-head){align-items:flex-start}
  body :where(.panel-head > *, .section-head > *){max-width:100%}
  body :where(.form-actions,.actions,.order-actions,.delivery-actions,.payment-admin-actions,.media-actions,.ticket-actions){width:100%}
  body :where(.form-actions .btn,.actions .btn,.order-actions .btn,.delivery-actions .btn,.payment-admin-actions .btn,.media-actions .btn,.ticket-actions .btn){flex:1 1 140px;max-width:100%}
  body :where(.theme-toggle,.tn-global-theme-toggle){max-width:calc(100vw - 24px)}
}
@media(max-width:430px){
  body :where(.form-actions .btn,.actions .btn,.order-actions .btn,.delivery-actions .btn,.payment-admin-actions .btn,.media-actions .btn,.ticket-actions .btn){flex-basis:100%}
  body :where(.grid2){grid-template-columns:minmax(0,1fr)!important}
}

/* Auth pages. */
html[data-theme="light"] :where(.box,.auth-boot-card){background:#fff!important;color:var(--tn-text)!important;border-color:var(--tn-border)!important}
html[data-theme="dark"] :where(.box,.auth-boot-card){background:var(--tn-surface)!important;color:var(--tn-text)!important;border-color:var(--tn-border)!important}

/* Keep image loading/hero visuals intact. */
img{max-width:100%;}

/* Remove accidental legacy hard-coded text fills from common UI. */
html[data-theme="light"] body :where([style*="color:#fff"],[style*="color:#ffffff"],[style*="color: white"]):not(.btn):not(.primary):not(.btn-accent):not(.slide-overlay *):not(.hero-overlay *):not(.image-overlay *){
  color:var(--tn-text)!important;-webkit-text-fill-color:var(--tn-text)!important;
}
html[data-theme="dark"] body :where([style*="color:#000"],[style*="color:#111"],[style*="color:#17121f"],[style*="color:#211936"]):not(.btn):not(.primary):not(.btn-accent){
  color:var(--tn-text)!important;-webkit-text-fill-color:var(--tn-text)!important;
}

/* ================================================================
   TOPINEXUS V14 — FINAL THEME + VISIBILITY + CONTROL INTEGRITY
   This block is intentionally last and is the single final override.
   ================================================================ */
:root{
  --tn-v14-light-bg:#f6f3fb;
  --tn-v14-light-surface:#ffffff;
  --tn-v14-light-surface-2:#f1ecf8;
  --tn-v14-light-border:#d8cfe5;
  --tn-v14-light-text:#211936;
  --tn-v14-light-muted:#625a70;
  --tn-v14-light-accent:#6d28d9;
  --tn-v14-dark-bg:#0c0813;
  --tn-v14-dark-surface:#171126;
  --tn-v14-dark-surface-2:#211936;
  --tn-v14-dark-border:#3b2d53;
  --tn-v14-dark-text:#f8f5ff;
  --tn-v14-dark-muted:#b5abc4;
  --tn-v14-dark-accent:#a78bfa;
}
html[data-theme="light"]{
  --v14-bg:var(--tn-v14-light-bg);
  --v14-surface:var(--tn-v14-light-surface);
  --v14-surface-2:var(--tn-v14-light-surface-2);
  --v14-border:var(--tn-v14-light-border);
  --v14-text:var(--tn-v14-light-text);
  --v14-muted:var(--tn-v14-light-muted);
  --v14-accent:var(--tn-v14-light-accent);
  color-scheme:light!important;
}
html[data-theme="dark"]{
  --v14-bg:var(--tn-v14-dark-bg);
  --v14-surface:var(--tn-v14-dark-surface);
  --v14-surface-2:var(--tn-v14-dark-surface-2);
  --v14-border:var(--tn-v14-dark-border);
  --v14-text:var(--tn-v14-dark-text);
  --v14-muted:var(--tn-v14-dark-muted);
  --v14-accent:var(--tn-v14-dark-accent);
  color-scheme:dark!important;
}

/* Base viewport and inherited text. */
html,body{background:var(--v14-bg)!important;color:var(--v14-text)!important;overflow-x:hidden!important}
body{min-width:0!important}

/* All common text-bearing elements follow the active theme. */
body :where(h1,h2,h3,h4,h5,h6,p,li,dt,dd,td,th,label,legend,summary,strong,em,small,.title,.name,.label,.value,.description,.subtitle,.sub,.dim,.section-head,.panel-head,.panel-title,.panel-subtitle,.stat-value,.stat-label,.nav-label,.menu-label,.card-name,.card-price,.card-cat,.p-name,.p-price,.p-old,.delivery-title,.delivery-sub,.auth-hint,.payment-title,.status-text,.helper-text,.form-hint){
  color:var(--v14-text)!important;
  -webkit-text-fill-color:var(--v14-text)!important;
}
body :where(.muted,.text-muted,.text-dim,.text-faint,.inline-note,.secure,.auth-hint,.dim,.subtle){
  color:var(--v14-muted)!important;
  -webkit-text-fill-color:var(--v14-muted)!important;
}
body :where(a:not(.btn):not(.notice-btn):not(.theme-toggle)){color:var(--v14-accent)}

/* Theme-aware surfaces, including common third-party/widget-like containers. */
body :where(.panel,.panel-lite,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.payment-method,.payment-method-btn,.ticket-item,.ticket-msg,.support-menu,.tn-topnav-menu,[role="dialog"],[role="menu"]){
  background:var(--v14-surface)!important;
  color:var(--v14-text)!important;
  border-color:var(--v14-border)!important;
}
body :where(.panel,.panel-lite,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,[role="dialog"],[role="menu"]) :where(h1,h2,h3,h4,h5,h6,p,span,div,label,strong,small,a,li){color:inherit!important;-webkit-text-fill-color:inherit!important}

/* Form controls: always readable in both themes. */
body :where(input:not([type="color"]),textarea,select,[contenteditable="true"]){
  box-sizing:border-box!important;width:100%;max-width:100%!important;min-width:0!important;
  background:var(--v14-surface)!important;color:var(--v14-text)!important;
  -webkit-text-fill-color:var(--v14-text)!important;caret-color:var(--v14-text)!important;
  border:1px solid var(--v14-border)!important;
}
body :where(input,textarea)::placeholder{color:var(--v14-muted)!important;-webkit-text-fill-color:var(--v14-muted)!important;opacity:1!important}
body option{background:var(--v14-surface)!important;color:var(--v14-text)!important}

/* Controls: explicit variants prevent inherited theme colors from breaking labels. */
body :where(button,.btn,a.btn,.notice-btn){box-sizing:border-box!important;min-width:0!important;max-width:100%!important;line-height:1.25!important;overflow-wrap:anywhere!important;word-break:break-word!important}
body :where(.btn,.btn.primary,.btn-accent,a.btn){background:var(--v14-accent)!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:var(--v14-accent)!important}
body :where(.btn.secondary,.btn.ghost,.btn.mini,.btn.sm.secondary,.icon-btn,.notice-btn,.tab-btn,.password-toggle,.theme-toggle,.tn-global-theme-toggle){background:var(--v14-surface-2)!important;color:var(--v14-text)!important;-webkit-text-fill-color:var(--v14-text)!important;border-color:var(--v14-border)!important}
body :where(.btn.danger){background:#c6284d!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:#c6284d!important}

/* Theme controls: never hide the useful label on normal phone widths. */
body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;
  min-width:72px!important;min-height:40px!important;height:40px!important;padding:0 11px!important;
  border:1px solid var(--v14-border)!important;border-radius:12px!important;
  background:var(--v14-surface-2)!important;color:var(--v14-text)!important;
  -webkit-text-fill-color:var(--v14-text)!important;font-weight:800!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
body :where(.theme-toggle .theme-icon,.theme-toggle .theme-label,#themeBtn .theme-icon,#themeBtn .theme-label,.tn-theme-icon,.tn-theme-label){color:inherit!important;-webkit-text-fill-color:inherit!important}

/* Navigation and floating menus. */
body :where(.tn-topnav-menu,.menu-list,.sidebar nav,#side-nav){color:var(--v14-text)!important}
body :where(.tn-topnav-menu a,.menu-list a,.menu-list button,.sidebar nav a,#side-nav a,.nav-item){color:var(--v14-text)!important;-webkit-text-fill-color:var(--v14-text)!important;min-width:0!important}
body :where(.tn-topnav-menu a:hover,.tn-topnav-menu a.active,.menu-list a:hover,.menu-list button:hover,#side-nav a:hover,#side-nav a.active){background:var(--v14-surface-2)!important;color:var(--v14-text)!important}
body :where(.tn-nav-symbol,.tn-side-symbol){color:currentColor!important;-webkit-text-fill-color:currentColor!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 22px!important;width:22px!important;height:22px!important;line-height:1!important}
body :where(.tn-nav-symbol svg){width:18px!important;height:18px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.9!important;stroke-linecap:round!important;stroke-linejoin:round!important}

/* Support widget: emojis are intentionally retained here, as requested. */
body :where(.support-float,.support-main,.support-menu){z-index:99999!important}
body :where(.support-main,.support-menu){background:var(--v14-surface)!important;color:var(--v14-text)!important;border-color:var(--v14-border)!important}
body :where(.support-menu a){color:var(--v14-text)!important;-webkit-text-fill-color:var(--v14-text)!important}
body :where(.support-menu a:hover){background:var(--v14-surface-2)!important}

/* Image/colored-surface text is intentionally white in both themes. */
body :where(.slide-overlay,.hero-overlay,.image-overlay,.cat-chip,.support-main,.btn.primary,.btn-accent,.btn.danger) :where(h1,h2,h3,h4,h5,h6,p,span,a,strong,small){color:#fff!important;-webkit-text-fill-color:#fff!important}

/* Global containment: nothing may escape its panel. */
body :where(main,section,article,aside,header,footer,nav,form,.container,.content,.main,.panel,.panel-body,.panel-head,.card,.card-body,.card-footer,.sheet,.modal,.box,.gate-card,.stat-card,.ticket-card,.order-card,.product-card,.grid,.grid2,.cat-row,.toolbar,.actions,.form-actions,.upload-row,.payment-admin-actions,.media-actions,.order-actions,.delivery-actions,.profile-head,.section-head,.topbar-inner,.header-icons,.notice-inner,.notice-copy,.table-wrap,.field,.widget,.widget-card,.floating-panel,.drawer,.popover,.dropdown){min-width:0!important;max-width:100%!important}
body :where(.panel,.card,.box,.modal,.sheet,.stat-card,.ticket-card,.order-card,.product-card,.widget,.widget-card,.floating-panel,.drawer,.popover,.dropdown){overflow:hidden!important}
body :where(.panel-head,.panel-header,.section-head,.form-actions,.actions,.toolbar,.upload-row,.order-actions,.delivery-actions,.payment-admin-actions,.media-actions,.ticket-actions){display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important;min-width:0!important;max-width:100%!important}
body :where(.panel-head>*,.panel-header>*,.section-head>*,.form-actions>*,.actions>*,.toolbar>*,.upload-row>*,.order-actions>*,.delivery-actions>*,.payment-admin-actions>*,.media-actions>*,.ticket-actions>*){min-width:0!important;max-width:100%!important}
body :where(td,th,.card-name,.card-cat,.card-price,.p-name,.p-price,.description,.ticket-msg,.ticket-item,.delivery-secret){overflow-wrap:anywhere!important;word-break:break-word!important}
body :where(.btn,.notice-btn,.theme-toggle,#themeBtn,#theme,.icon-btn){text-align:center!important}

/* Mobile header: keep every meaningful control visible without clipping. */
@media(max-width:680px){
  body :where(.topbar-inner){display:flex!important;align-items:center!important;gap:6px!important;min-width:0!important;max-width:100%!important}
  body :where(.topbar-inner>.brand){flex:0 0 auto!important;min-width:0!important}
  body :where(.brand-name){display:none!important}
  body :where(.header-icons){display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:5px!important;flex:1 1 auto!important;min-width:0!important}
  body :where(.track-link){display:none!important}
  body :where(.currency-switcher){width:78px!important;min-width:68px!important;max-width:82px!important;font-size:11px!important}
  body :where(.theme-toggle,#themeBtn,#theme){width:auto!important;min-width:68px!important;max-width:86px!important;padding:0 9px!important}
  body :where(.theme-toggle .theme-label,#themeBtn .theme-label){display:inline!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  body :where(.icon-btn,.tn-topnav-toggle){flex:0 0 40px!important;width:40px!important;min-width:40px!important;height:40px!important}
  body :where(.tn-topnav-menu){width:min(220px,calc(100vw - 20px))!important;max-width:calc(100vw - 20px)!important}
}
@media(max-width:430px){
  body :where(.theme-toggle,#themeBtn,#theme){min-width:42px!important;width:42px!important;max-width:42px!important;padding:0!important}
  body :where(.theme-toggle .theme-label,#themeBtn .theme-label){display:none!important}
  body :where(.currency-switcher){width:72px!important;min-width:66px!important}
  body :where(.icon-btn,.tn-topnav-toggle){flex-basis:38px!important;width:38px!important;min-width:38px!important;height:38px!important}
}

/* Admin sidebar symbols stay readable instead of becoming tiny glyphs. */
body :where(#side-nav a){min-height:40px!important;padding:9px 10px!important}
body :where(#side-nav a .tn-side-symbol){font-size:17px!important;font-weight:800!important}

/* Legacy inline light/dark colors on text elements are neutralized safely. */
html[data-theme="light"] body :where(h1,h2,h3,h4,h5,h6,p,span,label,small,strong,em,li,td,th,a:not(.btn),button:not(.btn):not(.primary)){color:var(--v14-text)!important;-webkit-text-fill-color:var(--v14-text)!important}
html[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,p,span,label,small,strong,em,li,td,th,a:not(.btn),button:not(.btn):not(.primary)){color:var(--v14-text)!important;-webkit-text-fill-color:var(--v14-text)!important}
/* Restore intentional semantic/accent text after the neutral text sweep. */
body :where(.accent,.link-btn,.track-link,.ticket-link,.section-head a,.discount-tag){color:var(--v14-accent)!important;-webkit-text-fill-color:var(--v14-accent)!important}
body :where(.btn,.btn.primary,.btn-accent,.btn.danger,.support-main) :where(span,strong,small){color:inherit!important;-webkit-text-fill-color:inherit!important}

/* Accessibility: visible keyboard focus in either theme. */
body :where(button,a,input,textarea,select):focus-visible{outline:2px solid var(--v14-accent)!important;outline-offset:2px!important}


/* ================================================================
   TOPINEXUS V15 — FINAL THEME CONTRAST + COMPONENT ISOLATION
   One deterministic palette; component text inherits the active theme.
   ================================================================ */
html[data-theme="dark"] body{--tn-bg:#0b0812;--tn-surface:#171126;--tn-surface-2:#211936;--tn-border:#3b2d53;--tn-text:#f7f4ff;--tn-muted:#b7aec8;--tn-accent:#a78bfa;color:var(--tn-text)!important;background:var(--tn-bg)!important}
html[data-theme="light"] body{--tn-bg:#f7f4fb;--tn-surface:#ffffff;--tn-surface-2:#f1edf7;--tn-border:#d9d0e4;--tn-text:#21182d;--tn-muted:#62596f;--tn-accent:#6d28d9;color:var(--tn-text)!important;background:var(--tn-bg)!important}
/* Theme-safe inheritance. */
html[data-theme="dark"] body :where(.panel,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.payment-method,.payment-method-btn,[role="dialog"],[role="menu"]){background:var(--tn-surface)!important;color:var(--tn-text)!important;border-color:var(--tn-border)!important}
html[data-theme="light"] body :where(.panel,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.payment-method,.payment-method-btn,[role="dialog"],[role="menu"]){background:var(--tn-surface)!important;color:var(--tn-text)!important;border-color:var(--tn-border)!important}
html[data-theme="dark"] body :where(.panel,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.payment-method,.payment-method-btn,[role="dialog"],[role="menu"]) :where(h1,h2,h3,h4,h5,h6,p,span,div,label,small,strong,em,li,td,th){color:inherit!important;-webkit-text-fill-color:inherit!important}
html[data-theme="light"] body :where(.panel,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card,.payment-method,.payment-method-btn,[role="dialog"],[role="menu"]) :where(h1,h2,h3,h4,h5,h6,p,span,div,label,small,strong,em,li,td,th){color:inherit!important;-webkit-text-fill-color:inherit!important}
/* Plain page text that has no semantic class must follow the theme. */
html[data-theme="dark"] body :where(main,section,article,aside,footer,form,header,nav) :where(h1,h2,h3,h4,h5,h6,p,label,legend,small,strong,em,li,td,th){color:var(--tn-text)!important;-webkit-text-fill-color:var(--tn-text)!important}
html[data-theme="light"] body :where(main,section,article,aside,footer,form,header,nav) :where(h1,h2,h3,h4,h5,h6,p,label,legend,small,strong,em,li,td,th){color:var(--tn-text)!important;-webkit-text-fill-color:var(--tn-text)!important}
/* Inputs are always explicit, never dependent on inherited color. */
html[data-theme="dark"] body :where(input:not([type="color"]),textarea,select){background:#151020!important;color:#f7f4ff!important;-webkit-text-fill-color:#f7f4ff!important;border-color:#3b2d53!important;caret-color:#f7f4ff!important}
html[data-theme="light"] body :where(input:not([type="color"]),textarea,select){background:#fff!important;color:#21182d!important;-webkit-text-fill-color:#21182d!important;border-color:#d1c7dd!important;caret-color:#21182d!important}
html[data-theme="dark"] body :where(input,textarea)::placeholder{color:#aaa0b8!important;-webkit-text-fill-color:#aaa0b8!important;opacity:1!important}
html[data-theme="light"] body :where(input,textarea)::placeholder{color:#62596f!important;-webkit-text-fill-color:#62596f!important;opacity:1!important}
html[data-theme="dark"] body option{background:#151020!important;color:#f7f4ff!important}
html[data-theme="light"] body option{background:#fff!important;color:#21182d!important}
/* Theme button: compact, legible, and stable. */
body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){min-width:82px!important;width:auto!important;height:42px!important;min-height:42px!important;padding:0 12px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:clip!important;border-radius:12px!important}
body :where(.theme-toggle .theme-icon,.theme-toggle .tn-theme-icon,#themeBtn .tn-theme-icon,#theme .tn-theme-icon,.tn-theme-icon){width:18px!important;height:18px!important;display:grid!important;place-items:center!important;flex:0 0 18px!important;font-size:17px!important;line-height:1!important;color:inherit!important;-webkit-text-fill-color:inherit!important}
body :where(.theme-toggle .theme-label,.theme-toggle .tn-theme-label,#themeBtn .tn-theme-label,#theme .tn-theme-label,.tn-theme-label){display:inline!important;min-width:0!important;line-height:1!important;font-weight:800!important;color:inherit!important;-webkit-text-fill-color:inherit!important}
html[data-theme="dark"] body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){background:#211936!important;color:#f7f4ff!important;border-color:#493763!important}
html[data-theme="light"] body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){background:#fff!important;color:#21182d!important;border-color:#d1c7dd!important}
@media(max-width:430px){body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){min-width:42px!important;width:42px!important;padding:0!important}body :where(.theme-toggle .theme-label,.theme-toggle .tn-theme-label,#themeBtn .tn-theme-label,#theme .tn-theme-label){display:none!important}}
/* Accent/semantic text is intentionally not neutralized. */
body :where(.accent,.link-btn,.track-link,.section-head a,.discount-tag,.error,.err,.danger-text,.success-text){color:var(--tn-accent)!important;-webkit-text-fill-color:var(--tn-accent)!important}
/* Buttons keep their intentional contrast. */
html[data-theme="dark"] body :where(.btn:not(.secondary):not(.ghost),.btn.primary,.btn-accent){background:#8b5cf6!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="light"] body :where(.btn:not(.secondary):not(.ghost),.btn.primary,.btn-accent){background:#6d28d9!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="dark"] body :where(.btn.secondary,.btn.ghost,.icon-btn,.password-toggle,.notice-btn){background:#211936!important;color:#f7f4ff!important;-webkit-text-fill-color:#f7f4ff!important;border-color:#493763!important}
html[data-theme="light"] body :where(.btn.secondary,.btn.ghost,.icon-btn,.password-toggle,.notice-btn){background:#f1edf7!important;color:#21182d!important;-webkit-text-fill-color:#21182d!important;border-color:#d1c7dd!important}
/* Support bubble is icon-only; menu keeps useful labels. */
body :where(.support-main){width:52px!important;height:52px!important;min-width:52px!important;max-width:52px!important;padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important;overflow:hidden!important}
body :where(.support-main svg){width:25px!important;height:25px!important;display:block!important;fill:none!important;stroke:currentColor!important;stroke-width:1.9!important;stroke-linecap:round!important;stroke-linejoin:round!important}
html[data-theme="dark"] body :where(.support-main){background:#211936!important;color:#f7f4ff!important;border-color:#493763!important}
html[data-theme="light"] body :where(.support-main){background:#fff!important;color:#21182d!important;border-color:#d1c7dd!important}


/* V15 product variants */
.variant-row{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.variant-btn{box-sizing:border-box;min-width:0;max-width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);color:var(--text);font:inherit;font-weight:800;line-height:1.25;overflow-wrap:anywhere;cursor:pointer}.variant-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}
/* Never let a text-bearing flex child force its panel wider. */
body :where(.top,.actions,.methods,.item,.item-main,.method,.method-copy,.summary,.row,.chips,.variant-row,.variant-editor-grid,.variant-editor-row){min-width:0;max-width:100%}body :where(.item-main,.method-copy){overflow-wrap:anywhere}body :where(.item-name,.method strong,.method small,.muted){overflow-wrap:anywhere}


/* V16 — deterministic final contrast pass. Any ordinary text inherits the active theme. */
html[data-theme="dark"] body,
html[data-theme="dark"] body *{color:#f7f4ff!important;-webkit-text-fill-color:#f7f4ff!important}
html[data-theme="light"] body,
html[data-theme="light"] body *{color:#21182d!important;-webkit-text-fill-color:#21182d!important}
/* Controls with their own intentional contrast. */
html[data-theme="dark"] body input:not([type="color"]),html[data-theme="dark"] body textarea,html[data-theme="dark"] body select{background:#151020!important;color:#f7f4ff!important;-webkit-text-fill-color:#f7f4ff!important;border-color:#3b2d53!important}
html[data-theme="light"] body input:not([type="color"]),html[data-theme="light"] body textarea,html[data-theme="light"] body select{background:#fff!important;color:#21182d!important;-webkit-text-fill-color:#21182d!important;border-color:#d1c7dd!important}
html[data-theme="dark"] body input::placeholder,html[data-theme="dark"] body textarea::placeholder{color:#aaa0b8!important;-webkit-text-fill-color:#aaa0b8!important}
html[data-theme="light"] body input::placeholder,html[data-theme="light"] body textarea::placeholder{color:#62596f!important;-webkit-text-fill-color:#62596f!important}
html[data-theme="dark"] body option{background:#151020!important;color:#f7f4ff!important}
html[data-theme="light"] body option{background:#fff!important;color:#21182d!important}
/* Semantic colors restored after the universal text pass. */
body :where(.accent,.link-btn,.track-link,.ticket-link,.section-head a,.card-cat,.cat-tag,.discount-tag,.error,.err,.danger-text){color:var(--tn-accent)!important;-webkit-text-fill-color:var(--tn-accent)!important}
body :where(.muted,.text-muted,.text-dim,.text-faint,.inline-note,.secure,.delivery-sub,.auth-hint){color:var(--tn-muted)!important;-webkit-text-fill-color:var(--tn-muted)!important}
body :where(.btn,.btn.primary,.btn-accent,.btn.danger,.support-main) :where(*),body :where(.btn,.btn.primary,.btn-accent,.btn.danger,.support-main){color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="dark"] body :where(.btn.secondary,.btn.ghost,.icon-btn,.password-toggle,.notice-btn,.tab-btn){background:#211936!important;color:#f7f4ff!important;-webkit-text-fill-color:#f7f4ff!important;border-color:#493763!important}
html[data-theme="light"] body :where(.btn.secondary,.btn.ghost,.icon-btn,.password-toggle,.notice-btn,.tab-btn){background:#f1edf7!important;color:#21182d!important;-webkit-text-fill-color:#21182d!important;border-color:#d1c7dd!important}
/* Hero/image surfaces intentionally use white labels. */
body :where(.slide-overlay,.hero-overlay,.image-overlay,.cat-chip,.support-main) :where(*) ,
body :where(.slide-overlay,.hero-overlay,.image-overlay,.cat-chip,.support-main){color:#fff!important;-webkit-text-fill-color:#fff!important}
/* Theme control never clips or wraps its label. */
body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){box-sizing:border-box!important;min-width:42px!important;width:auto!important;max-width:112px!important;height:42px!important;min-height:42px!important;padding:0 11px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;white-space:nowrap!important;overflow:hidden!important;flex:0 0 auto!important}
body :where(.theme-toggle .theme-label,.theme-toggle .tn-theme-label,#themeBtn .tn-theme-label,#theme .tn-theme-label,.tn-theme-label){display:inline-block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;line-height:1!important}
@media(max-width:430px){body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){width:42px!important;min-width:42px!important;max-width:42px!important;padding:0!important}body :where(.theme-toggle .theme-label,.theme-toggle .tn-theme-label,#themeBtn .tn-theme-label,#theme .tn-theme-label,.tn-theme-label){display:none!important}}
/* Product/category titles always readable; never inherit an old hard-coded opposite color. */
body :where(.p-name,.p-price,.card-name,.card-price,.section-head h1,.section-head h2,.section-head h3,.section-head h4,.product-title,.category-title){color:var(--tn-text,#f7f4ff)!important;-webkit-text-fill-color:var(--tn-text,#f7f4ff)!important}
html[data-theme="light"] body :where(.p-name,.p-price,.card-name,.card-price,.section-head h1,.section-head h2,.section-head h3,.section-head h4,.product-title,.category-title){color:#21182d!important;-webkit-text-fill-color:#21182d!important}
/* Support ball is logo-only, no text layout. */
body :where(.support-main){width:52px!important;height:52px!important;min-width:52px!important;max-width:52px!important;padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important;overflow:hidden!important}
body :where(.support-main) svg{width:25px!important;height:25px!important;display:block!important}
/* Content containment: no panel child may create horizontal overflow. */
body :where(.panel,.card,.box,.modal,.sheet,.drawer,.popover,.dropdown,.widget,.widget-card,.floating-panel,.dialog,.ticket-card,.order-card,.product-card,.stat-card,.gate-card){min-width:0!important;max-width:100%!important;overflow:hidden!important;box-sizing:border-box!important}
body :where(button,a,input,textarea,select){box-sizing:border-box!important;max-width:100%!important;min-width:0!important}
body :where(button,a.btn,.btn){overflow-wrap:anywhere!important;word-break:normal!important}


/* ================================================================
   TOPINEXUS V18 — FINAL READABILITY + BRAND/HEADING LOCK
   Explicitly protect store branding and storefront section titles from
   legacy/hard-coded colors while keeping image overlays white.
   ================================================================ */
html[data-theme="dark"] body :where(.brand,.brand-name,#brand-name,[data-tn-brand-name],.tn-universal-brand-copy strong,.section-head h1,.section-head h2,.section-head h3,.section-head h4){
  color:#f7f4ff!important;-webkit-text-fill-color:#f7f4ff!important;
}
html[data-theme="light"] body :where(.brand,.brand-name,#brand-name,[data-tn-brand-name],.tn-universal-brand-copy strong,.section-head h1,.section-head h2,.section-head h3,.section-head h4){
  color:#21182d!important;-webkit-text-fill-color:#21182d!important;
}
/* The accent part of the brand remains accent-colored, but readable in both themes. */
html[data-theme="dark"] body :where(.brand-name span,.brand span){color:#a78bfa!important;-webkit-text-fill-color:#a78bfa!important}
html[data-theme="light"] body :where(.brand-name span,.brand span){color:#6d28d9!important;-webkit-text-fill-color:#6d28d9!important}
/* Theme controls never show a wrapped/half-visible label. */
body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;line-height:1!important}
@media(max-width:430px){body :where(.theme-toggle,#themeBtn,#theme,.tn-global-theme-toggle){font-size:0!important}body :where(.theme-toggle .theme-icon,.theme-toggle .tn-theme-icon,#themeBtn .tn-theme-icon,#theme .tn-theme-icon,.tn-theme-icon){font-size:17px!important}}
