/* Final shared theme layer. Keep legacy components on the active palette,
   without recolouring logos, product artwork or semantic status indicators. */
html[data-site-theme="nightfall"] {
  color-scheme: dark;
  --ui-page:#0c1202;--ui-panel:#111907;--ui-raised:#19260e;--ui-input:#0f1605;
  --ui-line:#30431e;--ui-text:#f0f5e7;--ui-muted:#a0b08f;--ui-accent:#bffa00;
  --ui-primary:#bffa00;--ui-primary-text:#172100;--ui-hover:#202e11;--ui-shadow:rgba(0,0,0,.25);
}
html[data-site-theme="lime_pearl"] {
  color-scheme: light;
  --ui-page:#f6f9f2;--ui-panel:#fff;--ui-raised:#f1f7eb;--ui-input:#fff;
  --ui-line:#d2e1c4;--ui-text:#25391e;--ui-muted:#5c714f;--ui-accent:#527d14;
  --ui-primary:#a5db4b;--ui-primary-text:#172c0b;--ui-hover:#eaf3df;--ui-shadow:rgba(44,75,26,.08);
}
html[data-site-theme],html[data-site-theme] body {
  --sg-site-bg:var(--ui-page);--sg-site-panel:var(--ui-panel);--sg-site-panel-2:var(--ui-raised);
  --sg-site-border:var(--ui-line);--sg-site-text:var(--ui-text);--sg-site-muted:var(--ui-muted);--sg-site-lime:var(--ui-accent);
  --adm-bg:var(--ui-page);--adm-sidebar:var(--ui-panel);--adm-panel:var(--ui-panel);--adm-panel-2:var(--ui-raised);
  --adm-line:var(--ui-line);--adm-line-strong:var(--ui-accent);--adm-text:var(--ui-text);--adm-muted:var(--ui-muted);--adm-lime:var(--ui-accent);
  --tp-admin-bg:var(--ui-page);--tp-admin-surface:var(--ui-panel);--tp-admin-surface-2:var(--ui-raised);--tp-admin-border:var(--ui-line);--tp-admin-muted:var(--ui-muted);--tp-admin-green:var(--ui-accent);
  --sg-admin-bg:var(--ui-page);--sg-admin-panel:var(--ui-panel);--sg-admin-panel-2:var(--ui-raised);--sg-admin-line:var(--ui-line);--sg-admin-text:var(--ui-text);--sg-admin-muted:var(--ui-muted);--sg-admin-lime:var(--ui-accent);
  background-color:var(--ui-page)!important;
}
/* Specificity deliberately exceeds the legacy .main / #header rules. */
html[data-site-theme] body.has-navbar-vertical-aside,
html[data-site-theme] body.has-navbar-vertical-aside #content,
html[data-site-theme] body.has-navbar-vertical-aside .main,
html[data-site-theme] body.has-navbar-vertical-aside .content,
html[data-site-theme] body.has-navbar-vertical-aside .dashboard-height {
  background:var(--ui-page)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #header,
html[data-site-theme] body.has-navbar-vertical-aside :is(.navbar-vertical,.navbar-vertical-container,.navbar-vertical-content,.navbar-vertical-footer-offset,.navbar-vertical-footer) {
  background:var(--ui-panel)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #header :is(.navbar-input-group,.btn-icon),
html[data-site-theme] body.has-navbar-vertical-aside :is(.tp-sidebar-profile,.sg-sidebar-tools) {
  background:var(--ui-raised)!important;border-color:var(--ui-line)!important;color:var(--ui-muted)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #header .navbar-input-group :is(input,.input-group-text) {background:transparent!important;color:var(--ui-text)!important;}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(.card,.panel,.widget,.table-responsive,.bg-white,.bg-light,.bg-dark),
html[data-site-theme] body.has-navbar-vertical-aside :is(.modal-content,.offcanvas,.dropdown-menu,.popover,.accordion-item,.list-group-item) {
  background:var(--ui-panel)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(.card-header,.card-footer,.thead-light,.table th,.table tfoot,.table tfoot td,.dataTables_info,.dataTables_length,.dataTables_paginate,.nav-segment),
html[data-site-theme] body.has-navbar-vertical-aside :is(.modal-header,.modal-footer,.offcanvas-header,.dropdown-header,.note-toolbar,.ql-toolbar) {
  background:var(--ui-raised)!important;border-color:var(--ui-line)!important;color:var(--ui-muted)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(.table,.table td,.table tr) {
  --bs-table-bg:transparent;--bs-table-color:var(--ui-text);--bs-table-hover-bg:var(--ui-hover);
  background-color:transparent!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #content .table tr:hover {background:var(--ui-hover)!important;}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(.form-control,.form-select,.input-group-text,select,textarea),
html[data-site-theme] body.has-navbar-vertical-aside :is(.ts-control,.ts-dropdown,.select2-selection,.select2-dropdown,.flatpickr-calendar,.daterangepicker,.note-editable,.note-editor,.ql-container,.ql-editor) {
  background:var(--ui-input)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(.btn-white,.btn-outline-secondary,.page-link,.pagination .page-link),
html[data-site-theme] body.has-navbar-vertical-aside :is(.dropdown-item,.accordion-button) {
  background:var(--ui-raised)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #content .page-item.active .page-link {
  background:var(--ui-primary)!important;border-color:var(--ui-primary)!important;color:var(--ui-primary-text)!important;
}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(h1,h2,h3,h4,h5,h6,.card-title,.card-header-title,.page-header-title,.text-body,.text-dark,.display-5),
html[data-site-theme] body.has-navbar-vertical-aside :is(.tp-sidebar-profile strong,.modal-title) {color:var(--ui-text)!important;}
html[data-site-theme] body.has-navbar-vertical-aside #content :is(.text-muted,.text-secondary,.form-text,.breadcrumb-link,.breadcrumb-item),
html[data-site-theme] body.has-navbar-vertical-aside #header :is(.navbar-aside-toggler,.navbar-input-group),
html[data-site-theme] body.has-navbar-vertical-aside .navbar-vertical :is(.nav-link,.dropdown-header,.tp-sidebar-profile small) {color:var(--ui-muted)!important;}
html[data-site-theme] body.has-navbar-vertical-aside .navbar-vertical .nav-link:is(:hover,.active) {background:var(--ui-hover)!important;color:var(--ui-accent)!important;border-color:var(--ui-line)!important;}
html[data-site-theme] body.has-navbar-vertical-aside #content .tp-admin-footer {background:var(--ui-panel)!important;color:var(--ui-muted)!important;border-color:var(--ui-line)!important;}
/* Dynamically inserted legacy widgets get the same palette as static pages. */
html[data-site-theme] body .sg-legacy-navy,
html[data-site-theme] body.has-navbar-vertical-aside .sg-blue-surface,
html[data-site-theme] body.has-navbar-vertical-aside #content .sg-legacy-navy,
html[data-site-theme] body.has-navbar-vertical-aside #header .sg-legacy-navy {
  background-color:var(--ui-panel)!important;background-image:none!important;border-color:var(--ui-line)!important;
  transition-property:transform,opacity!important;
}
html[data-site-theme] body .sg-legacy-navy.sg-large-surface {background-color:var(--ui-page)!important;}
html[data-site-theme] body.has-navbar-vertical-aside :is(.dropdown-item:hover,.ts-dropdown .option.active,.select2-results__option--highlighted,.flatpickr-day:hover) {background:var(--ui-hover)!important;color:var(--ui-accent)!important;}
html[data-site-theme] body.has-navbar-vertical-aside :is(input,select,textarea,button,a):focus-visible {outline:2px solid var(--ui-accent);outline-offset:3px;}
html[data-site-theme].sg-theme-ready * {scrollbar-color:var(--ui-line) var(--ui-page);}
@media(forced-colors:active){html[data-site-theme] body *{forced-color-adjust:auto}}
/* Storefront account/notification flyouts also appear on wallet and order pages. */
html[data-site-theme] body :is(.tp-profile-trigger,.tp-account-menu,.user-dropdown,.notification-panel,.notification-dropdown) {
  background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;
}
html[data-site-theme] body .tp-account-menu :is(a,button,strong) {color:var(--ui-text)!important;}
html[data-site-theme] body .tp-account-menu :is(a,button):hover {background:var(--ui-hover)!important;color:var(--ui-accent)!important;}
html[data-site-theme] body .site-wrapper .profile-box #tp-desktop-profile-menu.tp-account-menu,
html[data-site-theme] body .site-wrapper .tp-mobile-profile #tp-mobile-profile-menu.tp-account-menu,
html[data-site-theme] body .site-wrapper .tp-account-menu :is(.user-dropdown-header,.user-dropdown-body,.user-dropdown-footer,.tp-order-sections,.user-balance) {
  background:var(--ui-panel)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;
}
html[data-site-theme] body .site-wrapper .tp-account-menu :is(.user-name,.user-email,.user-dropdown-grid a,.tp-account-orders summary,.tp-order-sections a) {color:var(--ui-text)!important;}
html[data-site-theme="lime_pearl"] body .site-wrapper :is(.tp-seller,.tp-game,.gift-options) {background:var(--ui-panel)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;}
html[data-site-theme="lime_pearl"] body .site-wrapper :is(.tp-seller,.tp-game) :is(h3,strong,.tp-game-name) {color:var(--ui-text)!important;}
html[data-site-theme="lime_pearl"] body .ap-card-title>span {background:var(--ui-raised)!important;color:var(--ui-accent)!important;}
html[data-site-theme="lime_pearl"] body .site-wrapper .tp-mobile-toggle {background:var(--ui-raised)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;}
/* Interactive primary states use lime too; danger/warning/info states stay semantic. */
html[data-site-theme] body input:is([type="checkbox"],[type="radio"]) {accent-color:var(--ui-accent);}
html[data-site-theme] body .form-check-input:checked {background-color:var(--ui-primary)!important;border-color:var(--ui-accent)!important;}
html[data-site-theme] body input[type="checkbox"].form-check-input:checked {background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23172100' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m5 10 3 3 7-7'/%3e%3c/svg%3e")!important;}
html[data-site-theme] body .form-switch input.form-check-input {background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%237b8f69'/%3e%3c/svg%3e")!important;}
html[data-site-theme] body .form-switch input.form-check-input:checked {background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23172100'/%3e%3c/svg%3e")!important;}
html[data-site-theme] body :is(.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.daterangepicker td.active,.daterangepicker .ranges li.active,.nav-pills .nav-link.active) {background:var(--ui-primary)!important;border-color:var(--ui-primary)!important;color:var(--ui-primary-text)!important;}
html[data-site-theme] body .progress-bar:not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-success) {background-color:var(--ui-accent)!important;}
