/* Parsisho — full-page night theme (follows the header day/night switch) */
html.ph-night{
  --ph-n-bg:#070e1a;
  --ph-n-surf:#0e1929;
  --ph-n-surf2:#122135;
  --ph-n-line:#22314a;
  --ph-n-text:#e8effb;
  --ph-n-muted:#9db0c9;
  --ph-n-dim:#7d90aa;
  color-scheme:dark;
}
html.ph-night body,
html.ph-night body.phg-body{background:var(--ph-n-bg) !important;color:var(--ph-n-text) !important}
html.ph-night #root,
html.ph-night #root main,
html.ph-night .phpg{background:transparent !important;color:var(--ph-n-text)}
html.ph-night #root section,
html.ph-night #root article,
html.ph-night .phpg section,
html.ph-night .phpg article{color:var(--ph-n-text)}

/* surfaces */
html.ph-night :is(#root,.phpg) :is([class*="bg-white"],[class*="bg-neutral-50"],[class*="bg-neutral-100"],[class*="bg-surface"],[class*="bg-primary-50"],[class*="bg-slate-50"],[class*="bg-gray-50"]){
  background-color:var(--ph-n-surf) !important;
}
html.ph-night :is(#root,.phpg) :is([class*="bg-white"]):is([class*="hover:bg-white"],[class*="bg-white/5"],[class*="bg-white/6"],[class*="bg-white/7"],[class*="bg-white/8"],[class*="bg-white/9"]){
  background-color:rgba(18,33,53,.92) !important;
}
html.ph-night :is(#root,.phpg) :is([class*="bg-primary-100"],[class*="bg-primary-50/"]){
  background-color:rgba(29,78,216,.18) !important;
}

/* text */
html.ph-night :is(#root,.phpg) :is([class*="text-neutral-9"],[class*="text-neutral-8"],[class*="text-neutral-7"],[class*="text-slate-9"],[class*="text-slate-8"],[class*="text-slate-7"],[class*="text-gray-9"],[class*="text-gray-8"],[class*="text-gray-7"]){
  color:var(--ph-n-text) !important;
}
html.ph-night :is(#root,.phpg) :is([class*="text-neutral-6"],[class*="text-neutral-5"],[class*="text-slate-6"],[class*="text-slate-5"],[class*="text-gray-6"],[class*="text-gray-5"]){
  color:var(--ph-n-muted) !important;
}
html.ph-night :is(#root,.phpg) :is([class*="text-neutral-4"],[class*="text-slate-4"],[class*="text-gray-4"]){
  color:var(--ph-n-dim) !important;
}
html.ph-night :is(#root,.phpg) :is(h1,h2,h3,h4,h5,h6){color:var(--ph-n-text)}
html.ph-night :is(#root,.phpg) :is(p,li,span,label){border-color:var(--ph-n-line)}

/* borders + dividers */
html.ph-night :is(#root,.phpg) [class*="border-neutral-"],
html.ph-night :is(#root,.phpg) [class*="border-slate-"],
html.ph-night :is(#root,.phpg) [class*="border-gray-"]{border-color:var(--ph-n-line) !important}
html.ph-night :is(#root,.phpg) hr{border-color:var(--ph-n-line)}

/* forms */
html.ph-night :is(#root,.phpg) :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){
  background-color:#0b1626 !important;color:var(--ph-n-text) !important;border-color:#26374f !important;
}
html.ph-night :is(#root,.phpg) :is(input,textarea)::placeholder{color:#7386a0 !important}

/* footer */
html.ph-night #root footer,
html.ph-night #ph-ftr{background:#08111e !important;color:#a9b8ce !important;border-color:#1b2a40 !important}
html.ph-night #root footer *{border-color:#1b2a40 !important}
html.ph-night #root footer :is(h1,h2,h3,h4,strong,b){color:#dbe6f5 !important}

/* hero intro band above the slider */
html.ph-night #root .ph-hero-head{background:transparent !important}
html.ph-night #root .ph-hero-head :is(h1,h2,p,span){position:relative;z-index:2}

/* market keeps its own night palette (synced by ph-night-sync.js) */
html.ph-night body.ph-market #root :is([class*="bg-white"],[class*="bg-neutral-50"],[class*="bg-neutral-100"],[class*="bg-surface"]){background-color:var(--ph-n-surf) !important}


/* brand accent text needs a lighter tone on dark surfaces */
html.ph-night :is(#root,.phpg) :is([class*="text-primary-5"],[class*="text-primary-6"],[class*="text-primary-7"],[class*="text-primary-8"],[class*="text-primary-9"]){color:#8ab4ff !important}
html.ph-night :is(#root,.phpg) :is([class*="text-accent-5"],[class*="text-accent-6"],[class*="text-accent-7"],[class*="text-accent-8"]){color:#ffa45c !important}
html.ph-night :is(#root,.phpg) :is([class*="text-local-6"],[class*="text-local-7"],[class*="text-local-8"]){color:#4ade80 !important}
html.ph-night :is(#root,.phpg) :is([class*="text-rose-6"],[class*="text-rose-7"],[class*="text-red-6"],[class*="text-red-7"]){color:#ff8a9a !important}
html.ph-night :is(#root,.phpg) :is([class*="text-emerald-6"],[class*="text-emerald-7"],[class*="text-green-6"],[class*="text-green-7"]){color:#4ade80 !important}

/* light gradient bands (from-white / via-surface / primary-50 tints) */
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="from-white"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="to-white"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="from-primary-50"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="via-surface"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="from-neutral-50"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="to-neutral-50"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="from-slate-50"],
html.ph-night :is(#root,.phpg) :is(section,div,article)[class*="from-gray-50"]{
  background-image:none !important;
  background-color:var(--ph-n-surf) !important;
}

/* homepage quick-access cards (custom glass components) */
html.ph-night .ph-quick > a{
  background-image:linear-gradient(180deg,#13233a 0%,#0d1828 100%) !important;
  border-color:#26374f !important;
  color:#e8effb !important;
}
html.ph-night .ph-quick > a :is(h3,b,strong,[class*="text-neutral-9"],[class*="text-neutral-8"],[class*="text-neutral-7"]){color:#eef4ff !important}
html.ph-night .ph-quick > a:hover{background-image:linear-gradient(180deg,#182a45 0%,#101d30 100%) !important;box-shadow:0 14px 30px -22px #000 !important}


/* any element that still paints a white gradient under a white utility class */
html.ph-night :is(#root,.phpg) [class*="bg-white"]{background-image:none !important}
html.ph-night #root .glass{background:rgba(13,24,40,.9) !important;border-color:#24344e !important}
html.ph-night #root .glass :is(h1,h2,h3,b,strong){color:var(--ph-n-text) !important}
/* special-section tiles keep their coloured icon, dark glass surface */
html.ph-night .ph-spec-inline a[class*="bg-white"]{background-color:#101c2e !important;background-image:linear-gradient(180deg,#13233a 0%,#0d1828 100%) !important;border-color:#26374f !important}
html.ph-night .ph-spec-inline a[class*="bg-white"] :is(span,p,small){color:var(--ph-n-muted) !important}


/* CMS content pages (page.php) */
html.ph-night .phpg :is(.phpg-stats,.phpg-stat,.phpg-article,.phpg-card){
  background:#0e1929 !important;border-color:#22314a !important;color:var(--ph-n-text) !important;
}
html.ph-night .phpg-steps > div{background:#0b1626 !important;border-color:#22314a !important;color:var(--ph-n-text) !important}
html.ph-night .phpg :is(.phpg-article,.phpg-card,.phpg-stats) :is(h1,h2,h3,h4,h5,strong,b){color:#eef4ff !important}
html.ph-night .phpg :is(.phpg-article,.phpg-card) :is(p,li,span){color:#c3d2e6 !important}
html.ph-night .phpg .phpg-info{background:rgba(29,78,216,.16) !important;border-color:#27466f !important;color:#d7e4ff !important}
html.ph-night .phpg .phpg-btn{background:#13233a !important;color:#e8effb !important;border-color:#26374f !important}
html.ph-night .phpg .phpg-stat-ic{background:rgba(29,78,216,.22) !important;color:#9dc0ff !important}


/* account centre */
html.ph-night .ac-tabs{background:rgba(14,25,41,.92) !important;border-color:#22314a !important;box-shadow:none !important}
html.ph-night .ac-tab[aria-selected="false"]{color:#9db0c9 !important}
html.ph-night .ac-tab[aria-selected="true"]{color:#fff !important}
html.ph-night .ac-nav-item{color:#c3d2e6 !important}
html.ph-night .ac-nav-item[aria-current="true"]{color:#9dc0ff !important;background:rgba(37,99,235,.18) !important}
html.ph-night .ac-nav-item.ac-nav-logout{color:#ff8a9a !important}
html.ph-night .ac-nav-item :is(span,svg){color:inherit !important;fill:currentColor !important}


/* success / info / warning / danger text */
html.ph-night :is(#root,.phpg) :is([class*="text-success-6"],[class*="text-success-7"],[class*="text-success-8"]){color:#34d399 !important}
html.ph-night :is(#root,.phpg) :is([class*="text-info-6"],[class*="text-info-7"]){color:#60a5fa !important}
html.ph-night :is(#root,.phpg) :is([class*="text-warning-6"],[class*="text-warning-7"]){color:#fbbf24 !important}
html.ph-night :is(#root,.phpg) :is([class*="text-danger-6"],[class*="text-danger-7"]){color:#f87171 !important}

/* excitement hub */
html.ph-night .phx-wrap,
html.ph-night .phx-body{background:#070e1a !important}
html.ph-night .phx-wrap :is(.phx-panel,.phx-stat,.phx-step,.phx-tile){
  background:#0e1929 !important;background-image:none !important;border-color:#22314a !important;color:var(--ph-n-text) !important;
}
html.ph-night .phx-wrap :is(.phx-name,.phx-cell b,.phx-cell h3){color:#eef4ff !important}
html.ph-night .phx-mark{opacity:.055 !important}
html.ph-night .phx-wrap :is(.phx-cell p,.phx-cell small,.phx-cell span){color:#c3d2e6}

/* smooth scrolling: freeze decoration paint while the page moves */
html.ph-scrolling *{animation-play-state:paused !important}
html.ph-scrolling header,
html.ph-scrolling header *{backdrop-filter:none !important;-webkit-backdrop-filter:none !important}
html.ph-scrolling header{background:rgba(255,255,255,.97) !important}
html.ph-night.ph-scrolling header{background:rgba(7,14,26,.97) !important}
