:root {
  --uv-radius-sm: 8px;
  --uv-radius: 12px;
  --uv-radius-lg: 16px;
  --uv-primary: #315bd4;
  --uv-primary-hover: #3d68df;
  --uv-primary-soft: rgba(49, 91, 212, .1);
  --uv-bg: #edf1f7;
  --uv-bg-deep: #e5eaf2;
  --uv-surface: #f9fbfe;
  --uv-surface-2: #f1f4f9;
  --uv-surface-3: #e8edf5;
  --uv-line: rgba(44, 57, 94, .13);
  --uv-line-strong: rgba(44, 57, 94, .22);
  --uv-text: #151c30;
  --uv-muted: #68728b;
  --uv-subtle: #8a93aa;
  --uv-shadow: 0 16px 38px rgba(42, 53, 84, .08);
  --uv-shadow-soft: 0 8px 22px rgba(42, 53, 84, .055);
  --uv-nav: rgba(249, 251, 254, .92);
}

:is([data-theme="business"], [data-theme="electric"]) {
  --uv-primary: #5577e9;
  --uv-primary-hover: #6485f1;
  --uv-primary-soft: rgba(85, 119, 233, .12);
  --uv-bg: #090d1a;
  --uv-bg-deep: #050711;
  --uv-surface: #101626;
  --uv-surface-2: #0c1220;
  --uv-surface-3: #161d30;
  --uv-line: rgba(179, 191, 230, .13);
  --uv-line-strong: rgba(179, 191, 230, .22);
  --uv-text: #edf1fa;
  --uv-muted: #9ca5bc;
  --uv-subtle: #707a95;
  --uv-shadow: 0 18px 44px rgba(0, 0, 0, .24);
  --uv-shadow-soft: 0 9px 26px rgba(0, 0, 0, .18);
  --uv-nav: rgba(6, 9, 19, .92);
  color-scheme: dark;
}

body:not(.brand-landing):not(.share-body) {
  --color-base-100: var(--uv-surface);
  --color-base-200: var(--uv-bg);
  --color-base-300: var(--uv-line-strong);
  --color-base-content: var(--uv-text);
  --color-primary: var(--uv-primary);
  --color-primary-content: #ffffff;
  --color-secondary: var(--uv-primary-hover);
  --color-secondary-content: #ffffff;
  --color-accent: var(--uv-primary);
  --color-neutral: var(--uv-text);
  --color-neutral-content: var(--uv-surface);
  --fallback-b1: var(--uv-surface);
  --fallback-b2: var(--uv-bg);
  --fallback-b3: var(--uv-line-strong);
  --fallback-bc: var(--uv-text);
  --fallback-p: var(--uv-primary);
  --fallback-pc: #ffffff;
  color: var(--uv-text) !important;
  background:
    radial-gradient(circle at 84% 0%, color-mix(in srgb, var(--uv-primary) 9%, transparent), transparent 29rem),
    linear-gradient(180deg, var(--uv-bg), var(--uv-bg-deep)) !important;
}

body:not(.brand-landing) > [data-layout-nav] {
  display: block;
  min-height: 3.5rem;
}

body.brand-landing > [data-layout-nav] {
  min-height: 0;
}

body:not(.brand-landing):not(.share-body) .v2-main {
  color: var(--uv-text);
  background: transparent !important;
}

body:not(.brand-landing) .v2-topnav {
  color: var(--uv-text) !important;
  background: var(--uv-nav) !important;
  border-bottom: 1px solid var(--uv-line) !important;
  box-shadow: 0 8px 28px rgba(20, 28, 54, .05) !important;
  backdrop-filter: blur(18px) saturate(135%);
}

body:not(.brand-landing) .v2-topnav-title { color: var(--uv-text) !important; }
body:not(.brand-landing) .v2-topnav-subtitle { color: var(--uv-subtle) !important; }
body:not(.brand-landing) .v2-topnav-link { color: var(--uv-muted) !important; }
body:not(.brand-landing) .v2-topnav-link:hover,
body:not(.brand-landing) .v2-topnav-link.is-active { color: var(--uv-primary) !important; }
body:not(.brand-landing) .v2-topnav-link::after { background: var(--uv-primary) !important; }
body:not(.brand-landing) .v2-quick-tool {
  color: var(--uv-muted) !important;
  border-color: var(--uv-line) !important;
  background: var(--uv-surface-2) !important;
}
body:not(.brand-landing) .v2-account-button {
  color: #fff !important;
  border-color: transparent !important;
  background: var(--uv-primary) !important;
  box-shadow: none !important;
}

body:not(.brand-landing) .v2-footer {
  color: var(--uv-muted) !important;
  background: var(--uv-bg-deep) !important;
  border-top-color: var(--uv-line) !important;
}

body:not(.brand-landing) :is(.v2-panel, .v2-card, .v2-modal-card) {
  color: var(--uv-text);
  border: 1px solid var(--uv-line) !important;
  border-radius: var(--uv-radius-lg) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}

body:not(.brand-landing) .v2-panel-hero {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--uv-primary) !important;
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--uv-primary) 10%, var(--uv-surface)), var(--uv-surface) 52%) !important;
}

body:not(.brand-landing) .v2-panel-hero::after {
  content: "";
  position: absolute;
  right: -5rem;
  top: -8rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid color-mix(in srgb, var(--uv-primary) 20%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

body:not(.brand-landing) :is(.btn, button, input, select, textarea) {
  border-radius: var(--uv-radius-sm) !important;
}

body:not(.brand-landing) .btn-primary {
  color: #fff !important;
  border-color: var(--uv-primary) !important;
  background: var(--uv-primary) !important;
  box-shadow: none !important;
}

body:not(.brand-landing) .btn-primary:hover {
  border-color: var(--uv-primary-hover) !important;
  background: var(--uv-primary-hover) !important;
}

body:not(.brand-landing) :is(.btn-outline, .btn-ghost) {
  color: var(--uv-text) !important;
  border-color: var(--uv-line-strong) !important;
  background: transparent !important;
}

body:not(.brand-landing) :is(.btn-outline, .btn-ghost):hover {
  color: var(--uv-primary) !important;
  border-color: color-mix(in srgb, var(--uv-primary) 48%, transparent) !important;
  background: var(--uv-primary-soft) !important;
}

body:not(.brand-landing) :is(.input, .select, .textarea, .v2-range-box) {
  color: var(--uv-text) !important;
  border-color: var(--uv-line-strong) !important;
  background: var(--uv-surface-2) !important;
  box-shadow: none !important;
}

body:not(.brand-landing) :is(.input, .select, .textarea):focus {
  border-color: var(--uv-primary) !important;
  outline: 3px solid color-mix(in srgb, var(--uv-primary) 14%, transparent) !important;
}

body:not(.brand-landing) :is(.badge, .v2-chip) {
  border-radius: 999px !important;
}

body:not(.brand-landing) .v2-stat,
body:not(.brand-landing) .v2-card-stat {
  border-color: var(--uv-line) !important;
  border-radius: var(--uv-radius) !important;
  background: var(--uv-surface-2) !important;
}

body:not(.brand-landing) :is(.stat-title, .stat-desc) { color: var(--uv-muted) !important; }
body:not(.brand-landing) .stat-value { color: var(--uv-text); }
body:not(.brand-landing) .v2-empty {
  color: var(--uv-muted);
  border: 1px dashed var(--uv-line-strong) !important;
  border-radius: var(--uv-radius-lg) !important;
  background: color-mix(in srgb, var(--uv-surface) 74%, transparent) !important;
}

/* Trade-up workspaces: preserve the mature layout, normalize its visual language. */
body.v2-page-tradeup:not(.brand-landing),
body.v2-page-chain:not(.brand-landing) {
  --cs2up-button-radius: var(--uv-radius-sm);
  --cs2up-chip-radius: 999px;
  --cs2up-control-radius: var(--uv-radius-sm);
  --cs2up-page-bg: var(--uv-bg);
  --cs2up-surface: var(--uv-surface);
  --cs2up-line: var(--uv-line);
  --cs2up-muted: var(--uv-muted);
}

body.v2-page-tradeup .v2-filter-panel,
body.v2-page-chain .v2-filter-panel {
  background: var(--uv-surface) !important;
}

body.v2-page-tradeup :is(.v2-filter-group, .v2-results-head),
body.v2-page-chain :is(.v2-filter-group, .v2-results-head) {
  border-color: var(--uv-line) !important;
  background: var(--uv-surface) !important;
}

body.v2-page-tradeup .v2-card:hover,
body.v2-page-chain .v2-card:hover {
  border-color: color-mix(in srgb, var(--uv-primary) 42%, transparent) !important;
  box-shadow: var(--uv-shadow) !important;
  transform: translateY(-2px);
}

/* Simulator */
body.v2-page-simulator .v2-main > .v2-panel:first-child {
  position: relative;
  border-left: 3px solid var(--uv-primary) !important;
  background: linear-gradient(105deg, var(--uv-primary-soft), var(--uv-surface) 50%) !important;
}

body.v2-page-simulator article.rounded-\[1\.7rem\],
body.v2-page-simulator article.rounded-\[1\.5rem\] {
  border-color: var(--uv-line) !important;
  border-radius: var(--uv-radius) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}

body.v2-page-simulator .simulator-material-filters {
  padding: 12px;
  border: 1px solid var(--uv-line);
  border-radius: var(--uv-radius);
  background: var(--uv-surface-2);
}

body.v2-page-simulator #results > div,
body.v2-page-simulator #bench > div {
  color: var(--uv-text);
}

/* Ranking */
body.rank-shell .rank-main { color: var(--uv-text); }
body.rank-shell .rank-hero {
  overflow: hidden;
  border: 1px solid var(--uv-line) !important;
  border-radius: var(--uv-radius-lg) !important;
  background:
    radial-gradient(circle at 88% 22%, color-mix(in srgb, var(--uv-primary) 16%, transparent), transparent 22rem),
    linear-gradient(115deg, color-mix(in srgb, var(--uv-primary) 10%, var(--uv-surface)), var(--uv-surface) 58%) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}

body.rank-shell .rank-hero::before,
body.rank-shell .rank-hero::after { display: none !important; }

body.rank-shell :is(.rank-hero-kicker, .rank-hero-chip-value) { color: var(--uv-primary) !important; }
body.rank-shell :is(.rank-hero-copy h1, .rank-hero-title) { color: var(--uv-text) !important; }
body.rank-shell :is(.rank-hero-copy p, .rank-hero-chip-label) { color: var(--uv-muted) !important; }
body.rank-shell .rank-overlap {
  border: 1px solid var(--uv-line) !important;
  border-radius: var(--uv-radius-lg) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow) !important;
}
body.rank-shell .rank-inline-filter {
  border-color: var(--uv-line) !important;
  background: var(--uv-surface-2) !important;
}
body.rank-shell .rank-search .btn,
body.rank-shell .rank-tabs .btn.btn-primary {
  color: #fff !important;
  border-color: var(--uv-primary) !important;
  background: var(--uv-primary) !important;
  background-image: none !important;
  box-shadow: none !important;
}
body.rank-shell .rank-tabs .btn.btn-outline {
  color: var(--uv-text) !important;
  border-color: var(--uv-line-strong) !important;
  background: var(--uv-surface) !important;
}
body.rank-shell .rank-inline-meta strong { color: var(--uv-text) !important; }
body.rank-shell :is(.rank-table-wrap, .rank-table-head) {
  color: var(--uv-text) !important;
  border-color: var(--uv-line) !important;
  background: var(--uv-surface) !important;
}

/* Software landing */
body.software-page {
  color: var(--uv-text) !important;
  background: linear-gradient(180deg, var(--uv-bg), var(--uv-bg-deep)) !important;
}
body.software-page .software-main { color: var(--uv-text); }
body.software-page .software-hero {
  border: 1px solid var(--uv-line) !important;
  border-radius: var(--uv-radius-lg) !important;
  background:
    radial-gradient(circle at 84% 20%, color-mix(in srgb, var(--uv-primary) 15%, transparent), transparent 28rem),
    linear-gradient(115deg, var(--uv-surface), var(--uv-surface-2)) !important;
  box-shadow: var(--uv-shadow) !important;
}
body.software-page :is(.software-hero h1, .software-section h2, .software-card h3) { color: var(--uv-text) !important; }
body.software-page :is(.software-hero p, .software-section p, .software-card p, .software-hero-list) { color: var(--uv-muted) !important; }
body.software-page :is(.software-card, .software-feature, .software-step, details) {
  color: var(--uv-text) !important;
  border-color: var(--uv-line) !important;
  border-radius: var(--uv-radius) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}

/* Help */
body.help-shell .help-main { color: var(--uv-text); }
body.help-shell .help-hero {
  border: 1px solid var(--uv-line) !important;
  border-left: 3px solid var(--uv-primary) !important;
  border-radius: var(--uv-radius-lg) !important;
  background: linear-gradient(105deg, var(--uv-primary-soft), var(--uv-surface) 55%) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}
body.help-shell :is(.help-hero h1, .help-section h2, .help-card b) { color: var(--uv-text) !important; }
body.help-shell :is(.help-hero p, .help-section p, .help-card p) { color: var(--uv-muted) !important; }
body.help-shell .help-kicker { color: var(--uv-primary) !important; }
body.help-shell :is(.help-side, .help-quick, .help-section, .help-card) {
  border-color: var(--uv-line) !important;
  border-radius: var(--uv-radius) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}
body.help-shell :is(.help-side, .help-quick) a { color: var(--uv-muted) !important; border-color: var(--uv-line) !important; background: var(--uv-surface) !important; }
body.help-shell .help-quick a::after { color: var(--uv-primary) !important; }
body.help-shell :is(.help-side, .help-quick) a:hover,
body.help-shell :is(.help-side, .help-quick) a.is-active { color: var(--uv-primary) !important; background: var(--uv-primary-soft) !important; }

/* Database / explore */
body.explore-page {
  color: var(--uv-text) !important;
  background: linear-gradient(180deg, var(--uv-bg), var(--uv-bg-deep)) !important;
}
body.explore-page .explore-main { color: var(--uv-text); }
body.explore-page .explore-hero {
  border: 1px solid var(--uv-line) !important;
  border-left: 3px solid var(--uv-primary) !important;
  border-radius: var(--uv-radius-lg) !important;
  background: linear-gradient(105deg, var(--uv-primary-soft), var(--uv-surface) 55%) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}
body.explore-page .explore-hero::after {
  background: color-mix(in srgb, var(--uv-primary) 11%, transparent) !important;
}
body.explore-page .explore-eyebrow,
body.explore-page :is(.explore-arrow, .guide-time) { color: var(--uv-primary) !important; }
body.explore-page :is(.explore-title, .explore-card h2, .explore-card h3) { color: var(--uv-text) !important; }
body.explore-page :is(.explore-lead, .explore-card p, .explore-count) { color: var(--uv-muted) !important; }
body.explore-page .explore-tab { color: var(--uv-muted) !important; border-color: var(--uv-line) !important; background: transparent !important; }
body.explore-page .explore-tab:hover,
body.explore-page .explore-tab.is-active { color: #fff !important; border-color: var(--uv-primary) !important; background: var(--uv-primary) !important; }
body.explore-page .explore-toolbar,
body.explore-page .explore-card {
  color: var(--uv-text) !important;
  border-color: var(--uv-line) !important;
  border-radius: var(--uv-radius) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}
body.explore-page .explore-card-media {
  border-color: var(--uv-line) !important;
  background: radial-gradient(circle at 50% 25%, var(--uv-primary-soft), transparent 65%), var(--uv-surface-2) !important;
}
body.explore-page .explore-search { color: var(--uv-text) !important; border-color: var(--uv-line-strong) !important; background: var(--uv-surface-2) !important; }

@media (min-width: 901px) {
  body.help-shell,
  body.explore-page {
    --cs2up-site-shell: min(1760px, calc(100% - clamp(48px, 5vw, 120px)));
  }

  body.help-shell .help-main,
  body.explore-page .explore-main {
    width: var(--cs2up-site-shell) !important;
    max-width: 1760px !important;
    margin-inline: auto !important;
  }
}

/* Referral */
body.v2-page-referral .referral-shell { color: var(--uv-text); }
body.v2-page-referral :is(.referral-panel, .referral-card) {
  color: var(--uv-text) !important;
  border-color: var(--uv-line) !important;
  border-radius: var(--uv-radius-lg) !important;
  background: var(--uv-surface) !important;
  box-shadow: var(--uv-shadow-soft) !important;
}

@media (max-width: 900px) {
  body:not(.brand-landing) .v2-mobile-nav-shell {
    color: var(--uv-text) !important;
    background: var(--uv-nav) !important;
    border-bottom: 1px solid var(--uv-line) !important;
  }
  body:not(.brand-landing) .v2-mobile-nav-panel {
    color: var(--uv-text) !important;
    border-color: var(--uv-line) !important;
    background: var(--uv-surface) !important;
  }
  body .v2-mobile-nav-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
  }
  body .v2-mobile-nav-actions > .v2-quick-tools {
    display: grid !important;
    min-width: 0 !important;
    width: 100% !important;
    grid-column: span 2 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
  }
  body .v2-mobile-nav-actions > .v2-theme-picker,
  body .v2-mobile-nav-actions > .v2-account-menu-wrap {
    min-width: 0 !important;
    width: 100% !important;
  }
  body .v2-mobile-nav-actions .v2-quick-tool {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
  body .v2-mobile-nav-actions > .v2-account-menu-wrap {
    grid-column: 1 / -1 !important;
  }
  body .v2-mobile-nav-actions .v2-account-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: flex-start !important;
  }
  body .v2-mobile-nav-actions .v2-account-text {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  body .v2-mobile-nav-account {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-wrap {
    position: relative !important;
    display: inline-flex !important;
  }
  body .v2-mobile-nav-account .v2-account-menu {
    position: absolute !important;
    top: calc(100% + .55rem) !important;
    right: -.2rem !important;
    bottom: auto !important;
    z-index: 120 !important;
    display: grid !important;
    width: min(18rem, calc(100vw - 1.5rem)) !important;
    gap: .45rem !important;
    border: 1px solid var(--uv-line) !important;
    border-radius: 1rem !important;
    background: var(--uv-surface) !important;
    color: var(--uv-text) !important;
    padding: .85rem !important;
    box-shadow: 0 22px 52px rgba(15, 23, 42, .18) !important;
  }
  body .v2-mobile-nav-account .v2-account-menu[hidden] {
    display: none !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-head {
    display: flex !important;
    align-items: center !important;
    gap: .7rem !important;
    padding: .15rem .2rem .65rem !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-avatar {
    display: inline-flex !important;
    width: 2.2rem !important;
    height: 2.2rem !important;
    flex: 0 0 2.2rem !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--uv-primary) 14%, transparent) !important;
    color: var(--uv-primary) !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-avatar svg {
    width: 1.15rem !important;
    height: 1.15rem !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-name {
    min-width: 0 !important;
    overflow: hidden !important;
    color: var(--uv-text) !important;
    font-size: .9rem !important;
    font-weight: 900 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-section,
  body .v2-mobile-nav-account .v2-account-menu .v2-theme-menu {
    display: grid !important;
    gap: .18rem !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-item,
  body .v2-mobile-nav-account .v2-theme-menu-item {
    display: flex !important;
    width: 100% !important;
    min-height: 2.35rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .55rem !important;
    border-radius: .72rem !important;
    color: var(--uv-text) !important;
    padding: .6rem .72rem !important;
    font-size: .86rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    text-align: left !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-divider {
    height: 1px !important;
    margin: .2rem -.85rem !important;
    background: var(--uv-line) !important;
  }
  body .v2-mobile-nav-account .v2-account-menu-label {
    padding: .1rem .72rem 0 !important;
    color: var(--uv-subtle) !important;
    font-size: .76rem !important;
    font-weight: 900 !important;
  }
  body.rank-shell .rank-overlap { margin-inline: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.brand-landing) *,
  body:not(.brand-landing) *::before,
  body:not(.brand-landing) *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
