/* NEXUS 2099 tokens — future editor maps directly to these variables. */
:root{
  --nx-bg:#07111c;--nx-surface:#101f2d;--nx-surface-soft:#162c3c;--nx-text:#f5faf9;--nx-muted:#96abb6;
  --nx-accent:#71f1d3;--nx-accent-2:#77a9fb;--nx-stroke:rgba(183,219,228,.14);
  --nx-radius:22px;--nx-container:1240px;--nx-font:system-ui,-apple-system,'Segoe UI',Tahoma,Arial,sans-serif;
}
html[data-nx2099-theme="light"]{
  --nx-bg:#f5f8fa;--nx-surface:#fff;--nx-surface-soft:#eef4f8;--nx-text:#112335;--nx-muted:#516576;
  --nx-accent:#087c77;--nx-accent-2:#315ecc;--nx-stroke:rgba(32,60,75,.13);
}


/* v0.6.39 — shared inner-page appearance and native selects.
   Uses the actual theme attribute managed by the shared navbar. */
:root{color-scheme:dark;--nx-ui-control:#0a1c2b;--nx-ui-option:#0c2535;--nx-ui-ink:#edfafa;--nx-ui-border:rgba(136,198,215,.24)}
html[data-nx2099-theme="light"]{color-scheme:light;--nx-ui-control:#ffffff;--nx-ui-option:#ffffff;--nx-ui-ink:#183147;--nx-ui-border:rgba(35,87,111,.22)}
/* Native option menus have OS constraints: style the control, option contrast and scheme,
   preserve their actual DOM elements and their original change/input events. */
html body select:not([multiple]):not([size]),
html body select[multiple],html body select[size]{
 color:var(--nx-ui-ink);background-color:var(--nx-ui-control);
 border-color:var(--nx-ui-border);color-scheme:dark;
 font-family:Tajawal,Arial,sans-serif;
}
html body select option,html body select optgroup{background:var(--nx-ui-option);color:var(--nx-ui-ink);font-family:Tajawal,Arial,sans-serif}
html body select:focus-visible{outline:2px solid var(--nx-accent);outline-offset:2px}
html[data-nx2099-theme="light"] body select{color-scheme:light}
html[data-nx2099-theme="light"] body :is(input,textarea):not([type="checkbox"]):not([type="radio"]){color-scheme:light}
/* Shared light-mode palettes for existing independently-scoped internal modules. */
html[data-nx2099-theme="light"] body :is(.nxal,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-ch,.nx-dc,.nxand,.nx-expire){
 --al-border:rgba(45,96,120,.18);--al-ink:#173248;--al-muted:#597487;--al-surface:#fff;--al-soft:#eaf5f8;
 --bg:#f2f8fb;--ink:#162f44;--muted:#5c7487;--stroke:rgba(34,89,117,.17);
 --nx-bg:#f5f8fa;--nx-surface:#fff;--nx-surface-soft:#eaf3f8;--nx-text:#183147;--nx-muted:#60788a;
 color:#183147;
}
/* Preserve strong hero art/gradient sections, convert ordinary information surfaces. */
html[data-nx2099-theme="light"] body :is(.nxal,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-ch,.nx-dc,.nxand,.nx-expire){background-color:transparent}
html[data-nx2099-theme="light"] body :is(.nxal,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-ch,.nx-dc,.nxand,.nx-expire) :is(input,textarea,select):not([type="checkbox"]):not([type="radio"]){
 background-color:#fff;color:#173247;border-color:rgba(33,91,115,.21)
}
html[data-nx2099-theme="light"] body :is(.nxal,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-ch,.nx-dc,.nxand,.nx-expire) :is(input,textarea)::placeholder{color:#7a8b98}
/* Main content panels (not hero banners), always keep white text on colored primary buttons. */
html[data-nx2099-theme="light"] body :is(.nxal,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-ch,.nx-dc,.nxand,.nx-expire) :is(.nxal-toolbar,.nxal-member,.nxal-app,.nxal-store,.nxal-card,.nxal-modal,.nxal-filter,.nxal-support){border-color:rgba(42,95,124,.19);color:#183147}
/* Scoped iOS theme fix: component used data-theme, navbar uses data-nx2099-theme. */
html[data-nx2099-theme="light"] #nxIosLibrary{
 --bg0:#f0f8fb;--bg1:#e4f3f7;--card:rgba(255,255,255,.97);--card2:#edf7fa;
 --st:rgba(30,90,120,.13);--st2:rgba(30,90,120,.21);--txt:#142b40;--mut:#647d8c;
 --sh:0 20px 50px rgba(30,70,105,.1);color:var(--txt);
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(input,select,textarea){background-color:#fff;color:#193447;border-color:rgba(25,84,111,.21);color-scheme:light}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.modal,.cModal){background-color:rgba(250,253,255,.97);border-color:rgba(12,55,85,.16);color:#173247}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.stateBadge,.upgAlert){color:#087965}
/* Classic bootstrap alerts retain semantic contrast in either mode. */
html[data-nx2099-theme="light"] body .alert.alert-danger{color:#7d2636}
html[data-nx2099-theme="light"] body .alert.alert-warning{color:#714f15}
@media(prefers-reduced-motion:reduce){html body select{scroll-behavior:auto}}


/* v0.6.40 — GLOBAL COMPONENT COLOR CONTRACT
   Applied only in light mode. Preserve branded covers / media / heroes.
   Do not replace native buttons or original PHP/JS event handlers. */
html[data-nx2099-theme="light"] {
 --nx-ui-panel:#ffffff;
 --nx-ui-panel-alt:#edf6fa;
 --nx-ui-subtle:#e7f2f7;
 --nx-ui-text:#173247;
 --nx-ui-text-muted:#597387;
 --nx-ui-stroke:rgba(38,89,115,.17);
 --nx-ui-focus:#087f83;
 --nx-ui-btn-text:#08283b;
 --nx-ui-danger:#a72d45;
}
/* Common semantic controls: no global .card/.btn changes, so visual marketing covers survive. */
html[data-nx2099-theme="light"] body :is(.nxal,.nx-ch,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-dc,.nxand,.nx-expire,#nxIosLibrary) :is(button,a,input,select,textarea):focus-visible{
 outline:2px solid var(--nx-ui-focus);outline-offset:3px;
}
html[data-nx2099-theme="light"] body :is(.nxal,.nx-ch,.nx-cl,.nx-cbx,.nx-orders,.nxpg,.nxpay,.nxpf,.nxre,.nxsv,.nxacc,.nxsub-shell,.nx-commerce,.nx-cat-page,.nx-dc,.nxand,.nx-expire,#nxIosLibrary) :is(button,input,textarea,select):disabled{
 opacity:.58;cursor:not-allowed;
}
/* iOS uses its own tokens and component hierarchy. Light palette must cover descendants,
   including custom modals and controls, not only their outer frame. */
html[data-nx2099-theme="light"] #nxIosLibrary{
 --txt:#173247;--mut:#587589;--card:#fff;--card2:#edf6fa;
 --st:rgba(32,87,114,.15);--st2:rgba(32,87,114,.25);
 --acc:#068b83;--acc2:#437ce2;
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.cardX,.toolbar,.iBoard,.appCard,.cModal,.appModalSection,.appModalFeatures,.infoRow,.storeCard,.miniInfo,.appChip,.hStat){
 border-color:var(--nx-ui-stroke);
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.cardX,.toolbar,.iBoard,.cModal){
 background:var(--nx-ui-panel);color:var(--nx-ui-text);
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.infoRow,.storeCard,.miniInfo,.appChip,.hStat,.appModalSection){
 background:var(--nx-ui-panel-alt);color:var(--nx-ui-text);
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.appCard,.appBody){color:#effcff}
/* Application cards intentionally retain dark, rich media backgrounds.
   All text/chips and buttons within them must remain readable. */
html[data-nx2099-theme="light"] #nxIosLibrary .appCard :is(.appName,.appDesc,.appChip,.appMeta){color:#eaf7ff}
html[data-nx2099-theme="light"] #nxIosLibrary .appCard .appChip{background:rgba(9,32,51,.55);border-color:rgba(166,227,241,.3)}
/* Header art is intentionally a rich gradient, so avoid inherited dark text. */
html[data-nx2099-theme="light"] #nxIosLibrary .heroMain,
html[data-nx2099-theme="light"] #nxIosLibrary .support{
 color:#f4fbff;
}
html[data-nx2099-theme="light"] #nxIosLibrary .heroMain :is(h1,h2,h3,.v,.heroLeft p,.k,.hStat .v),
html[data-nx2099-theme="light"] #nxIosLibrary .support :is(h1,h2,h3,p){color:#f4fbff}
html[data-nx2099-theme="light"] #nxIosLibrary .heroMain .hStat{background:rgba(5,28,44,.42);border-color:rgba(175,231,241,.18)}
html[data-nx2099-theme="light"] #nxIosLibrary .heroMain .hStat .k{color:#b8d5e5}
/* All app-info modal elements receive matching contrast in light mode. */
html[data-nx2099-theme="light"] #nxIosLibrary :is(.cModal,.cModalHead,.cModalBody,.appModalTop,.appModalName){color:#173247}
html[data-nx2099-theme="light"] #nxIosLibrary .cModalHead{border-color:var(--nx-ui-stroke);background:#f6fafc}
html[data-nx2099-theme="light"] #nxIosLibrary .appModalSection{
 background:#eaf4f8;color:#173247;border:1px solid var(--nx-ui-stroke)
}
html[data-nx2099-theme="light"] #nxIosLibrary .appModalSection h4{color:#007e7c}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.appModalFeatures,.appModalDesc){color:#38586d}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.appModalMeta,.cModalBody) .appChip{background:#e7f3f7;color:#24516b;border-color:var(--nx-ui-stroke)}
/* Preserve contrast of primary gradient actions; neutral secondary actions are light. */
html[data-nx2099-theme="light"] #nxIosLibrary :is(.iBtn,.appBtn.primary,.btn.primary){
 color:#08283b;background:linear-gradient(112deg,#67e9cf,#80b3f9);border-color:transparent;
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.iBtn,.appBtn.primary,.btn.primary):is(:hover,:focus-visible){
 color:#062638;filter:brightness(.98)
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.iBtnGhost,.appBtn.ghost,.btn:not(.primary),.cModalHead .x,.cModal .x){
 background:#eef6f9;color:#193c53;border:1px solid var(--nx-ui-stroke)
}
html[data-nx2099-theme="light"] #nxIosLibrary :is(.iBtnGhost,.appBtn.ghost,.btn:not(.primary),.cModalHead .x,.cModal .x):is(:hover,:focus-visible){
 background:#dceef4;color:#0a364e
}
/* Covers/collection cards keep their cinematic appearance. Contrast lives with the art. */
html[data-nx2099-theme="light"] .nx-ch{
 --ch-text:#18384c;--ch-muted:#637d8b;--ch-line:rgba(38,85,107,.17);
 --ch-panel:#ffffff;--ch-accent:#008b83;
}
html[data-nx2099-theme="light"] .nx-ch .nx-ch-collection{
 --ch-text:#f4fbff;--ch-muted:#b2c9d9;--ch-accent:#78f2d8;
 color:#f4fbff;
}
html[data-nx2099-theme="light"] .nx-ch .nx-ch-collection :is(h2,h3,p,strong,.nx-ch-collection__identity,.nx-ch-collection__count){color:inherit}
/* Shared legacy AJAX alert containers: semantic foregrounds on a light surface. */
html[data-nx2099-theme="light"] body :is(.alert-danger,.alert-warning,.alert-success,.alert-info){border-color:var(--nx-ui-stroke)}
html[data-nx2099-theme="light"] body .alert-success{color:#086b4a}
html[data-nx2099-theme="light"] body .alert-info{color:#175879}
@media(prefers-reduced-motion:reduce){
 html[data-nx2099-theme="light"] #nxIosLibrary :is(.iBtn,.iBtnGhost,.appBtn){transition:none}
}
