:root {
  color-scheme: dark;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #101116;
  --sidebar: #14151b;
  --surface: #191b23;
  --surface-deep: #14161d;
  --field: #222530;
  --border: #303340;
  --text: #f1f2f7;
  --muted: #b0b5c6;
  --subtle: #939bad;
  --accent: #b7a3ff;
  --accent-dim: #292437;
  --positive: #9ce4bd;
  --amber: #f4b66a;
  --track: #2b2e38;
  --danger: #ffb6b6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; scrollbar-gutter: stable; }
body { margin: 0; background: var(--background); color: var(--text); }
a { color: inherit; }
button, input { font: inherit; }
button, summary, input[type="range"] { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:active { background: var(--field); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 5px; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button svg { width: 1rem; height: 1rem; }
p, h1, h2, h3 { margin: 0; }
button { border: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 50; padding: .8rem 1.2rem; border-radius: .75rem; background: var(--accent); color: var(--background); }
.skip-link:focus { top: 1rem; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 15rem; display: flex; flex-direction: column; padding: 2.3rem 1rem 1.5rem; background: var(--sidebar); border-right: 1px solid #252731; z-index: 20; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; padding: 0 .8rem; margin-bottom: 3.75rem; }
.brand-mark { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 1px solid #494057; background: var(--accent-dim); border-radius: .85rem; color: var(--accent); }
.brand-mark svg { width: 1.75rem; height: 1.75rem; fill: currentColor; stroke: none; }
.brand strong { font-size: 1.75rem; line-height: 1; letter-spacing: -.07em; font-weight: 750; }
.brand-dot { color: var(--accent); }
.brand small { display: block; color: var(--muted); font-size: .75rem; letter-spacing: .02em; margin-top: .4rem; }
.nav-caption { color: var(--subtle); margin: 0 .8rem .8rem; font-size: .8125rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .75rem .8rem; color: var(--muted); border-radius: .7rem; text-decoration: none; font-size: 1rem; transition: color 160ms, background 160ms; margin-bottom: .3rem; }
.nav-link:hover { background: #20222b; color: var(--text); }
.nav-link.is-active { background: var(--accent-dim); color: #d0c3ff; }
.nav-dot { width: .3rem; height: .3rem; background: currentColor; border-radius: 50%; margin-left: auto; opacity: 0; }
.is-active .nav-dot { opacity: 1; }
.sidebar-bottom { margin-top: auto; }
.sidebar { overflow-y: auto; }
.suggestion-trigger { width: 100%; background: transparent; text-align: left; }
.sidebar-bottom > p { padding: 1.3rem .8rem 1.9rem; color: var(--subtle); font-size: .9375rem; line-height: 1.8; }
.version { display: flex; justify-content: space-between; color: var(--subtle); padding: .9rem .8rem 0; border-top: 1px solid #292b36; font-size: .75rem; letter-spacing: .02em; }
.version span { letter-spacing: 0; }
main { margin-left: 15rem; max-width: 95rem; padding: 3.3rem 3.5rem 1.5rem; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2.6rem; }
.eyebrow { color: var(--accent); font-size: .875rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 650; margin-bottom: .7rem; }
h1 { font-size: clamp(2rem, 3vw, 2.75rem); letter-spacing: -.045em; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.calculator { background: var(--surface); border: 1px solid var(--border); border-radius: 1.25rem; margin-bottom: 1.7rem; scroll-margin-top: 1.5rem; overflow: clip; }
.section-header { padding: 1.5rem 1.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border); }
.section-heading { display: flex; gap: .9rem; align-items: center; min-width: 0; }
.section-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: var(--accent-dim); border: 1px solid #41384f; border-radius: .8rem; color: var(--accent); flex-shrink: 0; }
h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.section-heading p { color: var(--muted); font-size: .9375rem; margin-top: .3rem; }
.reset-button { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .5rem .6rem; border-radius: .5rem; background: transparent; color: var(--muted); font-size: .9375rem; transition: color 160ms, background 160ms; flex-shrink: 0; }
.reset-button:hover { color: var(--text); background: var(--field); }
.calculator-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(21rem, .85fr); }
.controls { padding: 1.65rem 1.75rem; min-width: 0; }
.control-group h3 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; font-size: 1rem; font-weight: 600; margin-bottom: 1.2rem; }
.control-group h3 > span { color: var(--subtle); font-size: .8125rem; font-weight: 400; }
.addition-group { border-top: 1px solid var(--border); padding-top: 1.2rem; margin-top: 1.1rem; }
.slider-control + .slider-control { margin-top: 1.15rem; }
.field-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.field-header label { font-size: 1rem; color: #d9dce7; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.number-field { min-width: 0; display: flex; align-items: center; gap: .1rem; min-height: 3rem; border: 1px solid #4b5063; border-radius: .6rem; background: var(--field); padding: .1rem .5rem; flex-shrink: 0; }
.number-field:focus-within { border-color: var(--accent); }
.number-field input { width: 4.25rem; min-width: 0; min-height: 3rem; padding: .3rem .15rem; border: none; border-radius: .2rem; background: transparent; text-align: right; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); -moz-appearance: textfield; }
.number-field input:focus-visible { outline-offset: 1px; }
.number-field input::-webkit-inner-spin-button, .number-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 3rem; display: block; margin: .4rem 0 0; background: transparent; accent-color: var(--accent); }
.range::-webkit-slider-runnable-track { height: 1.625rem; border-radius: 999px; background: var(--track); }
.range::-moz-range-track { height: 1.625rem; border-radius: 999px; background: var(--track); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; margin-top: .0625rem; background: #f5f5fa; border: 0; box-shadow: 0 1px 4px #0005; }
.range::-moz-range-thumb { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #f5f5fa; border: 0; box-shadow: 0 1px 4px #0005; }
.range:active::-webkit-slider-thumb { box-shadow: 0 0 0 6px #b7a3ff26; }
.range:active::-moz-range-thumb { box-shadow: 0 0 0 6px #b7a3ff26; }
.range-scale { display: flex; justify-content: space-between; color: var(--subtle); font: .8125rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.field-note { margin-top: 1rem; color: var(--muted); font-size: .875rem; line-height: 1.7; max-width: 30rem; }
.field-error, .notice { color: var(--danger); font-size: .9375rem; margin-top: .6rem; line-height: 1.5; }
.number-field:has([aria-invalid="true"]) { border-color: var(--danger); }
.result-panel { container-type: inline-size; padding: 1.9rem 1.75rem 1.5rem; background: var(--surface-deep); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.result-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 1rem; }
.result-label svg { color: var(--accent); }
.result-number { color: var(--accent); display: block; font-size: clamp(1.75rem, 18cqi, 4.4rem); font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.065em; line-height: 1.15; margin-top: 1.1rem; white-space: nowrap; }
.result-number > span { font-size: .48em; margin-left: .08em; letter-spacing: -.04em; }
.result-term { color: var(--muted); font-size: 1rem; margin-top: .15rem; }
.gain-breakdown { margin-top: 1.9rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.gain-breakdown p { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; font-size: .9375rem; color: var(--muted); }
.gain-breakdown p + p { margin-top: .85rem; }
.gain-breakdown strong { font-size: 1rem; color: var(--text); white-space: nowrap; font-weight: 550; font-variant-numeric: tabular-nums; }
.comparison { margin-top: 1.7rem; padding-bottom: 1.5rem; }
.comparison > div:first-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: .875rem; color: var(--muted); margin-bottom: 1rem; }
.comparison-base { color: var(--subtle); font-size: .8125rem; }
.comparison-row { display: grid; grid-template-columns: 6.25rem minmax(0, 1fr) 5rem; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); }
.comparison-row + .comparison-row { margin-top: .65rem; }
.comparison-row strong { color: var(--muted); font: .875rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; text-align: right; }
.comparison-track { height: .35rem; background: #252935; border-radius: .5rem; overflow: hidden; }
.comparison-track i { display: block; height: 100%; background: #73798d; border-radius: .5rem; }
.after-row .comparison-track i { background: var(--accent); }
.after-row strong { color: var(--text); }
.new-values { margin: auto 0 0; padding-top: 1.1rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.new-values dt { color: var(--subtle); font-size: .875rem; }
.new-values dd { margin: .4rem 0 0; font-size: 1.25rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.cap-notice { margin-top: 1rem; padding: .8rem; background: #33291c; border: 1px solid #6d5536; border-radius: .5rem; color: #f5ce9d; font-size: .875rem; }
.formula { border-top: 1px solid var(--border); }
.formula summary { list-style: none; min-height: 3.5rem; padding: .85rem 1.75rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: 1rem; }
.formula summary::-webkit-details-marker { display: none; }
.formula summary:hover { color: var(--text); background: #ffffff03; }
.formula summary svg { width: 1rem; height: 1rem; transition: transform 180ms; }
.formula[open] summary svg { transform: rotate(180deg); }
.formula > div { padding: .3rem 1.75rem 1.5rem; color: var(--muted); max-width: 65rem; font-size: 1rem; line-height: 1.8; }
.formula p + p { margin-top: .7rem; }
.formula a { color: var(--accent); text-underline-offset: .2rem; }
.attribute { --accent: var(--amber); --accent-dim: #332b23; }
.attribute .section-icon { border-color: #544332; }
.attribute .controls, .attribute .result-panel { padding-top: 1.6rem; }
.attribute .result-number { font-size: clamp(1.75rem, 18cqi, 4.4rem); }
.stat-explanation { display: flex; align-items: flex-start; gap: .7rem; padding: .9rem; background: #1f212b; border: 1px solid #343845; border-radius: .7rem; margin-top: 1.6rem; color: var(--muted); }
.stat-explanation > span { border: 1px solid var(--subtle); border-radius: 50%; width: 1.125rem; height: 1.125rem; display: grid; place-items: center; font-size: .8125rem; flex-shrink: 0; line-height: 1; margin-top: .1rem; }
.stat-explanation p { font-size: .9375rem; line-height: 1.6; }
.stat-transition { display: flex; align-items: center; gap: 1rem; margin: 1.7rem 0 1.5rem; font-size: 1.6rem; letter-spacing: -.03em; color: var(--subtle); font-variant-numeric: tabular-nums; }
.stat-transition svg { color: var(--subtle); }
.stat-transition strong { color: var(--text); font-weight: 500; }
.page-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid #2b2e39; padding-top: 1.25rem; color: var(--subtle); font-size: .8125rem; }
.page-footer > span:first-child { font-weight: 700; font-size: .9rem; }
.page-footer > span:first-child > span:last-child { font-size: .8125rem; font-weight: 400; margin-left: .65rem; }
.field-value { max-width: 100%; display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.sign-toggle { flex-shrink: 0; display: grid; place-items: center; width: 2.75rem; min-height: 3rem; padding: 0; border: 1px solid #65577e; border-radius: .65rem; background: var(--accent-dim); color: var(--accent); font-size: 1.75rem; font-weight: 500; line-height: 1; transition: background 160ms, border-color 160ms; }
.sign-toggle:hover { border-color: var(--accent); }
.sign-toggle:active { background: var(--field); }
.sign-toggle[aria-pressed="true"] { border-color: #8d555c; color: var(--danger); background: #35232a; }
.number-unit { font-size: .875rem; color: var(--muted); }
.number-unit:empty { display: none; }
.result-number[data-trend="negative"] { color: var(--danger); }
.suggestion-open { overflow: hidden; }
.suggestion-dialog {
  --dialog-height: min(29rem, calc(100dvh - 2rem));
  --party-pink: #ff6b9e;
  --party-gold: #ffd166;
  --party-green: #9ce4bd;
  --party-blue: #80c8ff;
  --party-violet: #b7a3ff;
  --party-orange: #ff986b;
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(42rem, calc(100vw - 2rem));
  height: var(--dialog-height);
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: #000;
  color: var(--text);
  box-shadow: 0 2rem 6rem #0009;
  isolation: isolate;
}
.suggestion-dialog::backdrop { background: #000c; backdrop-filter: blur(5px); }
.suggestion-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.suggestion-close { position: absolute; top: .75rem; right: .75rem; z-index: 3; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 1px solid var(--border); border-radius: .8rem; background: var(--surface); color: var(--text); }
.suggestion-close:hover { background: var(--field); }
.suggestion-close svg { width: 1.25rem; height: 1.25rem; }
.suggestion-word { position: relative; z-index: 2; color: var(--party-violet); font-size: clamp(3.5rem, 14vw, 8rem); font-weight: 800; line-height: 1; letter-spacing: -.06em; animation: suggestion-spin 6s linear infinite, suggestion-color 7s linear infinite; }
.suggestion-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -1.5rem; left: var(--confetti-left); width: .45rem; height: .85rem; border-radius: var(--confetti-radius); background: var(--confetti-color); animation: confetti-fall var(--confetti-duration) linear var(--confetti-delay) infinite; will-change: transform; }
@keyframes suggestion-spin { to { transform: rotate(360deg); } }
@keyframes suggestion-color { 0%, 100% { color: var(--party-violet); } 20% { color: var(--party-pink); } 40% { color: var(--party-gold); } 60% { color: var(--party-green); } 80% { color: var(--party-blue); } }
@keyframes confetti-fall { from { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; } to { transform: translate3d(var(--confetti-drift), calc(var(--dialog-height) + 3rem), 0) rotate(var(--confetti-turn)); opacity: .3; } }
@media (min-width: 1700px) { main { margin-right: auto; margin-left: max(15rem, calc((100vw - 80rem) / 2)); padding-right: 4rem; max-width: 85rem; } }
@media (max-width: 1250px) { main { padding: 2.5rem 1.5rem 1.5rem; } .controls, .result-panel, .section-header { padding-inline: 1.25rem; } .calculator-body { grid-template-columns: 1fr; } .result-panel { border-left: 0; border-top: 1px solid var(--border); } .new-values { margin-top: 1rem; } .gain-breakdown { margin-top: 1.4rem; } .comparison { max-width: 36rem; } .result-number, .result-term { align-self: flex-start; } }
@media (max-width: 760px) { html { scroll-padding-top: 12rem; } .sidebar { position: sticky; inset: 0 0 auto; width: 100%; padding: .7rem 1rem .6rem; border-right: 0; border-bottom: 1px solid #383b49; background: #14151bf2; backdrop-filter: blur(18px); } .brand { padding: 0; margin: 0 0 .7rem; gap: .5rem; width: fit-content; } .brand-mark { width: 1.9rem; height: 1.9rem; border-radius: .6rem; } .brand-mark svg { width: 1.3rem; height: 1.3rem; } .brand strong { font-size: 1.5rem; } .brand small { display: inline; margin-left: .75rem; } .nav-caption, .nav-dot { display: none; } .sidebar nav { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; } .nav-link { justify-content: center; min-height: 2.75rem; padding: .5rem .4rem; margin: 0; font-size: .9375rem; } .nav-link svg { width: 1rem; height: 1rem; } .sidebar-bottom { display: block; margin-top: .5rem; } .sidebar-bottom > :not(.suggestion-trigger) { display: none; } main { margin-left: 0; padding: 1.8rem 1rem 1.2rem; } .page-header { margin-bottom: 1.6rem; } .calculator { border-radius: 1rem; scroll-margin-top: 0; } .section-header { padding: 1rem; gap: .5rem; } .section-heading { gap: .6rem; max-width: 100%; } .section-heading h2 { overflow-wrap: anywhere; } .section-icon { width: 2.25rem; height: 2.25rem; border-radius: .65rem; } .controls, .result-panel { container-type: inline-size; padding: 1.3rem 1rem; } .control-group h3 > span { display: none; } .field-header { flex-wrap: wrap; gap: .6rem; } .field-header label { flex: 1 1 7rem; } .field-value { margin-left: auto; } .number-field { padding-inline: .4rem; } .formula summary, .formula > div { padding-inline: 1rem; } .page-footer { flex-wrap: wrap; gap: .6rem; } }
@media (max-width: 480px) { .brand small { display: none; } .sidebar .nav-link { display: block; text-align: center; overflow-wrap: anywhere; } .sidebar .nav-link svg { display: none; } .new-values { flex-wrap: wrap; } .comparison-row { grid-template-columns: minmax(0, 6.25rem) minmax(0, 1fr) minmax(0, 5rem); } .comparison-row strong { overflow-wrap: anywhere; } }
@media (max-width: 370px) { .section-icon { display: none; } .field-header { gap: .5rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } .confetti-piece { top: var(--confetti-still-top); transform: rotate(var(--confetti-turn)); opacity: .65; will-change: auto; } }
@media (prefers-reduced-transparency: reduce) { .sidebar { background: var(--sidebar); backdrop-filter: none; } .suggestion-dialog::backdrop { background: #000; backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --border: #71798b; --muted: #d6daea; --subtle: #c1c8dc; --track: #525b70; } .sidebar { background: var(--sidebar); backdrop-filter: none; } }
