/* Shared calculator surfaces: the header now continues the tone of the first block. */
body:has(.cake-page),
body:has(.cashback-page),
body:has(.shashlyk-page),
body:has(.triangle-page),
body:has(.steps-page),
body:has(.warm-floor-page),
body:has(.laminate-page),
body:has(.quadratic-page),
body:has(.stacks-page) {
  background: #fff;
}

body:has(.squat-page) {
  background: #f8f6fa;
}

body:has(.bench-page) {
  background: #fbf8fc;
}

body:has(.decimal-page),
body:has(.log-page),
body:has(.genshin-page),
body:has(.ratio-page) {
  background: #fbf9fd;
}

body:has(.zodiac-page) {
  background: #f4eef8;
}

/* Slightly brighter muted labels keep result details readable on dark panels. */
.cake-result-panel .cake-main-result > span,
.cake-result-panel .cake-main-result p,
.cake-result-panel .cake-result-note p {
  color: #f0d2df;
}

.shashlyk-result-panel .shashlyk-result-stats span,
.shashlyk-result-panel .shashlyk-result-stats small {
  color: #e8cbd0;
}

.steps-result-side .steps-main-result > span,
.steps-result-side .steps-main-result p,
.steps-result-side .steps-visual-card span:not(.steps-visual-icon),
.steps-result-side .steps-result-note p {
  color: #dfcde6;
}

.triangle-result-side .triangle-result-grid span,
.triangle-result-side .triangle-formula-result span,
.squat-result-side .squat-result-grid small,
.bench-result-side .bench-result-grid small,
.decimal-result-side .decimal-result-expression,
.log-result-side .log-result-expression,
.genshin-result-side .genshin-result-stats span,
.ratio-result-side .ratio-result-expression,
.cb-result-grid article > span:not(.cb-result-icon),
.wf-result-grid article > span:not(.wf-result-icon),
.quad-result-grid span,
.lam-result-grid article > span.lam-result-card-label,
.stacks-result-grid article > span:not(.stacks-result-icon) {
  color: #dfcde6;
}

/* Result labels were the smallest text on several cards; keep them comfortable on mobile too. */
.triangle-result-side .triangle-result-grid span,
.triangle-result-side .triangle-formula-result span,
.squat-result-side .squat-result-grid small,
.bench-result-side .bench-result-grid small,
.wf-result-grid article > span:not(.wf-result-icon),
.shashlyk-result-panel .shashlyk-result-stats span,
.shashlyk-result-panel .shashlyk-result-stats small,
.cb-result-grid article > span:not(.cb-result-icon),
.quad-result-grid span,
.lam-result-grid article > span.lam-result-card-label,
.stacks-result-grid article > span:not(.stacks-result-icon) {
  font-size: 12px;
  line-height: 1.35;
}

.steps-result-side .steps-main-result p {
  font-size: 14px;
  line-height: 1.45;
}

/* The zodiac result has its own light treatment; its contrast is defined in zodiac.css. */

/* Zodiac-like calculator frame for the other calculator pages. K/D, Robux and the home page are intentionally excluded. */
body:has(.decimal-page) .decimal-calculator-panel,
body:has(.genshin-page) .genshin-calculator-panel,
body:has(.cashback-page) .cb-calculator,
body:has(.quadratic-page) .quad-calculator-panel,
body:has(.laminate-page) .lam-calculator,
body:has(.log-page) .log-calculator-panel,
body:has(.squat-page) .squat-calculator-panel,
body:has(.ratio-page) .ratio-calculator-panel,
body:has(.cake-page) .cake-calculator,
body:has(.steps-page) .steps-calculator-panel,
body:has(.shashlyk-page) .shashlyk-calculator,
body:has(.stacks-page) .stacks-calculator,
body:has(.warm-floor-page) .wf-calculator,
body:has(.triangle-page) .triangle-calculator-panel,
body:has(.bench-page) .bench-calculator-panel {
  border: 2px solid #d2b7df;
  border-radius: 28px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 0 0 5px rgba(123, 47, 190, .07), 0 24px 80px rgba(67, 32, 86, .14), 0 3px 0 rgba(255, 255, 255, .76) inset;
}

/* Make every result surface part of the same light lavender visual language. */
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) {
  background: radial-gradient(circle at 91% 12%, rgba(210, 180, 222, .36), transparent 28%), radial-gradient(circle at 12% 93%, rgba(123, 47, 190, .12), transparent 30%), linear-gradient(145deg, #fff 0%, #f7f0fa 57%, #eee3f5 100%) !important;
  color: var(--ink) !important;
  border-color: #dfcfe9 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9) !important;
}

/* Remove dark-only decorative rings that would look muddy on the light result surface. */
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
)::before,
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
)::after {
  content: none !important;
  display: none !important;
}

/* Rebalance inherited dark-panel text for the new light result surface. */
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is(h2, h3, strong, b) {
  color: var(--ink) !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is(p, small, em) {
  color: #66556d !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is([class$="-result-topline"], [class$="-result-head"], [class$="-status"], [class$="-ready"], [class$="-live"], [class$="-result-label"], [class$="-result-expression"]) {
  color: #765b82 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is([class*="result-grid"] span:not([class*="icon"]), [class*="main-result"] > span, [class*="formula-result"] span) {
  color: #765b82 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is([class*="result-grid"] > article, [class*="result-grid"] > div, [class*="solution-card"], [class*="vieta-card"]) {
  background: rgba(255, 255, 255, .78) !important;
  border-color: #d5bee2 !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) [class*="result-note"] {
  border-color: #dfcfe9 !important;
}

/* Keep inputs and primary actions consistent with the zodiac calculator. */
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-calculator-panel,
  .genshin-calculator-panel,
  .cb-calculator,
  .quad-calculator-panel,
  .lam-calculator,
  .log-calculator-panel,
  .squat-calculator-panel,
  .ratio-calculator-panel,
  .cake-calculator,
  .steps-calculator-panel,
  .shashlyk-calculator,
  .stacks-calculator,
  .wf-calculator,
  .triangle-calculator-panel,
  .bench-calculator-panel
) :is(input, select, textarea) {
  border-color: #d8cadf;
  background: #fcfafc;
  color: var(--ink);
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-calculator-panel,
  .genshin-calculator-panel,
  .cb-calculator,
  .quad-calculator-panel,
  .lam-calculator,
  .log-calculator-panel,
  .squat-calculator-panel,
  .ratio-calculator-panel,
  .cake-calculator,
  .steps-calculator-panel,
  .shashlyk-calculator,
  .stacks-calculator,
  .wf-calculator,
  .triangle-calculator-panel,
  .bench-calculator-panel
) :is(input, select, textarea):focus {
  border-color: var(--purple);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(123, 47, 190, .13);
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  button[class*="-submit"]
) {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
  box-shadow: 0 11px 22px rgba(123, 47, 190, .22);
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  button[class*="-reset"]
) {
  border-color: #d9cce1;
  background: transparent;
  color: #695c70;
}

@media (max-width: 700px) {
  body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
    .decimal-calculator-panel,
    .genshin-calculator-panel,
    .cb-calculator,
    .quad-calculator-panel,
    .lam-calculator,
    .log-calculator-panel,
    .squat-calculator-panel,
    .ratio-calculator-panel,
    .cake-calculator,
    .steps-calculator-panel,
    .shashlyk-calculator,
    .stacks-calculator,
    .wf-calculator,
    .triangle-calculator-panel,
    .bench-calculator-panel
  ) {
    border-radius: 23px;
  }
}

/* Catch legacy light text that was written for the previous dark result cards. */
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is(span, output, li):not([class*="icon"]):not([class*="visual"]):not([class*="emblem"]):not([class*="status"]):not([class*="ready"]):not(.genshin-result-emblem > span):not(.genshin-result-note > span):not(.cb-result-note > span):not(.stack-unit):not(.stack-more) {
  color: #765b82 !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .decimal-result-side,
  .genshin-result-side,
  .cb-result-panel,
  .quad-result-side,
  .lam-result-panel,
  .log-result-side,
  .squat-result-side,
  .ratio-result-side,
  .cake-result-panel,
  .steps-result-side,
  .shashlyk-result-panel,
  .stacks-result-panel,
  .wf-result-panel,
  .triangle-result-side,
  .bench-result-side
) :is(output, [class*="result-equation"], [class*="result-value"]) {
  color: var(--ink) !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .genshin-result-stats > div > span,
  .genshin-progress-block > div > span,
  .genshin-progress-block > small,
  .cb-benefit-meter > div > span,
  .stacks-visual-head > span,
  .stacks-inventory-meter > div > span,
  .wf-loop-check > div > span,
  .shashlyk-extras-heading > span,
  .shashlyk-extras-heading > small
) {
  color: #765b82 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) :is(
  .quad-solution-card li,
  .genshin-result-note p,
  .cb-result-note p,
  .wf-result-note p,
  .steps-result-note p,
  .shashlyk-result-note,
  .stacks-inventory-meter p
) {
  color: #66556d !important;
}

/* Final contrast accents for empty formulas and overflow indicators. */
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) .ratio-result-side .ratio-empty-symbol,
body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) .ratio-result-side .ratio-empty-symbol i {
  color: #765b82 !important;
}

body:not(:has(.kd-page)):not(:has(.rbx-page)):not(:has(.zodiac-page)) .stacks-result-panel .stack-more {
  color: #765b82 !important;
  border: 1px solid #d5bee2;
  border-radius: 10px;
  background: rgba(123, 47, 190, .08);
}

/* Triangle result: use the site's plum palette instead of pale yellow and white marks. */
.triangle-page .triangle-result-side .triangle-outline {
  stroke: #d24ea5 !important;
}

.triangle-page .triangle-result-side .triangle-height {
  stroke: rgba(77, 35, 96, .76) !important;
}

.triangle-page .triangle-result-side .triangle-vertex {
  fill: #c17add !important;
}

.triangle-page .triangle-result-side .triangle-svg-label {
  fill: #6a2d86 !important;
}

.triangle-page .triangle-result-side .triangle-svg-angle {
  fill: #552d70 !important;
}

.triangle-page .triangle-result-side .triangle-live i {
  background: #7b2fbe !important;
  box-shadow: 0 0 0 4px rgba(123, 47, 190, .16) !important;
}
