:root {
  --blue: #079bdd;
  --blue-strong: #007db7;
  --blue-soft: #e8f6fb;
  --ink: #0e1b24;
  --text: #2c3d48;
  --muted: #6c7e89;
  --line: #d7e5eb;
  --card: #ffffff;
  --canvas: #f3f8fb;
  --green: #13855d;
  --green-soft: #e9f7f1;
  --shadow: 0 18px 50px rgba(14, 38, 52, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, rgba(7, 155, 221, 0.11), transparent 28rem),
    linear-gradient(180deg, #f9fcfd 0, var(--canvas) 70%, #eef6f9 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 26px;
  padding: 24px 0 20px;
}

.brand { width: 136px; height: 86px; display: grid; place-items: center; overflow: hidden; box-sizing: border-box; }
.brand img { display: block; width: 124px; height: auto; max-height: 82px; object-fit: contain; transition: opacity .22s ease, transform .22s ease; }
.brand img.seasonal-logo { width: 124px; height: auto; max-width: 100%; max-height: 82px; object-fit: contain; object-position: center; }
.brand img.logo-switching { opacity: .18; transform: scale(.97); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.header-copy h1 { margin: 3px 0 5px; color: var(--ink); font-size: clamp(2rem, 4vw, 3.35rem); line-height: 0.98; letter-spacing: -0.045em; }
.header-copy p { margin: 0; color: var(--muted); font-size: 1rem; }
.eyebrow, .section-kicker { color: var(--blue-strong); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }
.section-kicker.light { color: rgba(255,255,255,.7); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-strong);
  border: 1px solid rgba(7, 155, 221, 0.25);
  background: rgba(255,255,255,.76);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 750;
}
.live-pill span { width: 8px; height: 8px; background: #21b477; border-radius: 50%; box-shadow: 0 0 0 5px rgba(33,180,119,.12); }
.live-pill b { font-weight: 750; }
.halloween-button { border: 1px solid #e5a34a; color: #8a4300; background: #fff4e4; padding: 9px 13px; border-radius: 999px; font-size: .76rem; font-weight: 800; transition: transform .2s ease, background .2s ease, color .2s ease; }
.halloween-button:hover, .halloween-button:focus-visible { transform: translateY(-1px); background: #ffe8c5; }
.sound-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(90,125,141,.2); color: var(--muted); background: rgba(255,255,255,.5); border-radius: 50%; font-size: .78rem; opacity: .7; transition: transform .2s ease, background .2s ease, color .2s ease, opacity .2s ease; }
.sound-button:hover, .sound-button:focus-visible { transform: translateY(-1px); color: var(--blue-strong); background: var(--blue-soft); opacity: 1; }
.sound-button[aria-pressed="true"] { color: var(--blue-strong); background: rgba(7,155,221,.1); border-color: rgba(7,155,221,.28); opacity: 1; }

.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 22px; align-items: start; overflow-anchor: none; }
.controls-panel, .results-panel, .tier-reference { border-radius: var(--radius); box-shadow: var(--shadow); }
.controls-panel { grid-column: 1; grid-row: 1; position: relative; z-index: 3; overflow: visible; background: var(--card); border: 1px solid rgba(199,220,229,.8); padding: 28px; }

.section-heading, .results-topline, .tier-card-heading, .breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.section-heading h2, .tier-reference h2 { color: var(--ink); margin: 3px 0 0; font-size: 1.6rem; letter-spacing: -.03em; }
.text-button, .copy-button { border: 0; border-radius: 999px; font-weight: 750; }
.text-button { color: var(--blue-strong); background: var(--blue-soft); padding: 9px 14px; }
.text-button:hover, .text-button:focus-visible { background: #d9f1fb; }

.control-stack { display: grid; gap: 14px; margin-top: 22px; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.control-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfe;
  padding: 17px 18px 14px;
  transition: opacity .2s ease, border-color .2s ease, background .2s ease;
}
.control-card:focus-within { border-color: rgba(7,155,221,.65); background: #fff; }
.deals-card { transition: background-color .24s ease, border-color .24s ease, box-shadow .24s ease; }
.deal-signal { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--green); font-size: .66rem; }
.deal-signal span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(35, 167, 110, .1); }
.deal-signal strong { font-weight: 800; }
.cpa-card { position: relative; overflow: hidden; transition: background-color .22s ease, border-color .22s ease, box-shadow .22s ease; }
.cpa-card label, .cpa-card .number-shell { transition: color .22s ease, border-color .22s ease, background-color .22s ease; }
.cpa-card > *:not(.crack-overlay) { position: relative; z-index: 1; }
.christmas-cpa-status { display:none; align-items:center; gap:7px; min-width:108px; padding:6px 9px; border:1px solid transparent; border-radius:999px; transition:color .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease; }
html[data-theme="christmas"] .christmas-cpa-status { display:inline-flex; }
.christmas-cpa-status > span:last-child { display:grid; gap:1px; min-width:0; margin:0; }
.christmas-cpa-status strong { color:inherit; font-size:.58rem; font-weight:950; line-height:1; white-space:nowrap; }
.christmas-cpa-status small { color:inherit; font-size:.46rem; font-weight:750; line-height:1.15; opacity:.76; white-space:nowrap; }
.christmas-cpa-icon { display:grid !important; place-items:center; flex:0 0 auto; width:23px; height:23px; margin:0 !important; border-radius:50%; color:white !important; font-size:.68rem !important; font-weight:950; }
.christmas-cpa-status[data-state="nice"] { color:#0f6343; border-color:rgba(19,112,77,.25); background:#e5f5eb; box-shadow:0 6px 16px rgba(19,112,77,.08); }
.christmas-cpa-status[data-state="nice"] .christmas-cpa-icon { background:#13704d; }
.christmas-cpa-status[data-state="watch"] { color:#815d09; border-color:rgba(198,146,28,.3); background:#fff5d7; box-shadow:0 6px 16px rgba(198,146,28,.1); }
.christmas-cpa-status[data-state="watch"] .christmas-cpa-icon { background:#c6921c; }
.christmas-cpa-status[data-state="naughty"] { color:#94142d; border-color:rgba(186,31,59,.26); background:#fde9ed; box-shadow:0 6px 16px rgba(186,31,59,.1); }
.christmas-cpa-status[data-state="naughty"] .christmas-cpa-icon { background:#ba1f3b; }
.crack-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: var(--crack-opacity, 0); pointer-events: none; transition: opacity .24s ease; }
.crack-overlay path { fill: none; stroke: rgba(128, 24, 35, .78); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.broken-message { position: absolute; inset: 0; display: grid; place-content: center; gap: 3px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.broken-message[hidden] { display: none; }
.broken-message strong { color: #8f1724; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.broken-message span { color: #a52c38; font-size: .72rem; font-weight: 800; }
.cpa-card .range { cursor: grab; }
.cpa-card .range:active { cursor: grabbing; }
.cpa-card.under-stress { animation: stress-shake var(--shake-speed, .6s) linear infinite; }
.cpa-card.critical { box-shadow: 0 12px 32px rgba(205,48,58,.2); }
.cpa-card.broken { animation: card-break .38s ease-out both; border-color: #9f1f2c !important; background: #f8c8cd !important; }
.cpa-card.broken .crack-overlay { z-index: 2; opacity: 1; }
.cpa-card.broken .broken-message { z-index: 3; opacity: 1; }
.cpa-card.broken > *:not(.crack-overlay):not(.broken-message) { opacity: .12; filter: blur(1.3px) grayscale(.35); }
@keyframes stress-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(var(--shake-neg), var(--shake-soft)) rotate(-.08deg); }
  40% { transform: translate(var(--shake), var(--shake-soft-neg)) rotate(.06deg); }
  60% { transform: translate(var(--shake-soft-neg), var(--shake-soft)) rotate(-.05deg); }
  80% { transform: translate(var(--shake), var(--shake-soft-neg)) rotate(.08deg); }
}
@keyframes card-break { 20% { transform: translateX(-4px) rotate(-.2deg); } 45% { transform: translateX(4px) rotate(.2deg); } 70% { transform: translateX(-2px); } 100% { transform: none; } }
.control-card.compact { padding-bottom: 16px; }
.control-card.disabled { opacity: .48; }
.control-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.control-heading label { display: block; color: var(--ink); font-weight: 780; font-size: .94rem; }
.control-heading span { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }

.number-shell {
  min-width: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid var(--line);
  background: white;
  border-radius: 11px;
  padding: 4px 8px;
}
.number-shell.currency::before { content: "$"; color: var(--muted); font-size: .82rem; }
.number-shell.suffix-hours::after { content: "hrs"; color: var(--muted); font-size: .68rem; margin-left: 3px; }
.number-shell input { width: 58px; border: 0; outline: 0; color: var(--ink); background: transparent; text-align: right; font-weight: 800; }
.number-shell.small { min-width: 70px; }
.number-shell.small input { width: 45px; }
.number-shell.aflac-value { min-width: 92px; }
.number-shell.aflac-value input { width: 64px; }

.range { --fill: 20%; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--range-color, var(--blue)) var(--fill), #dbe9ef var(--fill)); }
.range::-moz-range-track { height: 6px; border-radius: 999px; background: #dbe9ef; }
.range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--range-color, var(--blue)); }
.range::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; margin-top: -7px; background: white; border: 5px solid var(--range-color, var(--blue)); box-shadow: 0 3px 12px var(--range-shadow, rgba(7,155,221,.28)); }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: white; border: 5px solid var(--range-color, var(--blue)); box-shadow: 0 3px 12px var(--range-shadow, rgba(7,155,221,.28)); }
.range:focus-visible { outline: 2px solid rgba(7,155,221,.32); outline-offset: 5px; border-radius: 8px; }
.range:disabled { cursor: not-allowed; }
.range-labels { display: flex; justify-content: space-between; color: #91a1aa; font-size: .63rem; margin-top: -2px; }
.referral-return { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; padding: 8px 10px; border-radius: 10px; color: var(--blue-strong); background: var(--blue-soft); font-size: .68rem; }
.referral-return span { color: var(--muted); font-weight: 700; }
.referral-return strong { white-space: nowrap; font-size: .74rem; }

.optional-card { transition: opacity .2s ease, background-color .2s ease, border-color .2s ease; }
.optional-card.disabled { opacity: .55; background: #f5f8fa; }
.optional-amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.optional-amount > span { max-width: 190px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.switch-small .switch-track { width: 42px; height: 24px; }
.switch-small .switch-thumb { width: 18px; height: 18px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { display: block; position: relative; width: 48px; height: 28px; background: #adc2cc; border-radius: 999px; transition: background .2s; }
.switch-thumb { position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: white; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(7,155,221,.28); outline-offset: 3px; }
.switch-small input:checked + .switch-track .switch-thumb { transform: translateX(18px); }

.results-panel { grid-column: 2; grid-row: 1; position: sticky; z-index: 2; top: 18px; align-self: start; height: max-content; overflow: hidden; overflow-anchor: none; background: #0f202b; color: white; padding: 28px; }
.result-actions { display: flex; align-items: center; gap: 7px; }
.copy-button { color: white; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); padding: 8px 12px; font-size: .76rem; }
.copy-button:hover, .copy-button:focus-visible { background: rgba(255,255,255,.17); }
.share-card-button { color: #082b3e; background: #8edfff; border: 0; border-radius: 999px; padding: 8px 12px; font-size: .76rem; font-weight: 800; }
.share-card-button:hover, .share-card-button:focus-visible { background: #b6eaff; }
.total-block { margin: 22px 0 18px; }
.total-block > span { display: block; color: rgba(255,255,255,.68); font-size: .78rem; }
.total-block strong { display: block; font-size: clamp(3.1rem, 7vw, 5rem); line-height: 1; letter-spacing: -.06em; margin: 5px 0 8px; }
.total-block small { color: rgba(255,255,255,.7); }
.result-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 14px; }
.metric span, .metric small { display: block; color: rgba(255,255,255,.58); font-size: .7rem; }
.metric strong { display: block; margin: 2px 0; color: white; font-size: 1.4rem; }
.metric .status-good { color: #79dbae; }
.metric .status-base { color: #ffd277; }
.metric.metric-success { background: rgba(44, 183, 126, .15); border-color: rgba(75, 212, 154, .32); }

.recovery-card { max-height: 0; margin-top: 0; padding: 0 14px; overflow: hidden; opacity: 0; transform: translateY(-10px) scale(.985); color: white; border: 0 solid rgba(255,183,77,.32); border-radius: 14px; background: linear-gradient(135deg, rgba(210,91,32,.24), rgba(255,185,64,.11)); box-shadow: inset 3px 0 0 #f29b38; transition: max-height .38s cubic-bezier(.2,.8,.2,1), margin-top .38s cubic-bezier(.2,.8,.2,1), padding .38s cubic-bezier(.2,.8,.2,1), border-width .18s ease, opacity .24s ease, transform .38s cubic-bezier(.2,.8,.2,1); }
.recovery-card[hidden] { display: none; }
.recovery-card.is-visible { max-height: 210px; margin-top: 12px; padding: 14px; border-width: 1px; opacity: 1; transform: translateY(0) scale(1); }
.recovery-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recovery-topline span { color: #ffd09a; font-size: .61rem; font-weight: 900; letter-spacing: .1em; }
.recovery-topline strong { color: #ffbd68; font-size: .9rem; }
.recovery-card p { margin: 6px 0 10px; color: rgba(255,255,255,.88); font-size: .75rem; font-weight: 700; line-height: 1.4; }
.recovery-comparison { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.16); }
.recovery-comparison span { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; color: rgba(255,255,255,.56); font-size: .62rem; }
.recovery-comparison strong { color: white; font-size: .76rem; }
.recovery-comparison i { color: #ffbd68; font-style: normal; font-weight: 900; }
.next-tier-card { margin-top: 12px; padding: 13px 14px; color: white; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: linear-gradient(135deg, rgba(7,155,221,.16), rgba(33,180,119,.12)); }
.next-tier-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.next-tier-heading span { color: rgba(255,255,255,.55); font-size: .62rem; font-weight: 850; letter-spacing: .12em; }
.next-tier-heading strong { color: #85e8bd; font-size: .8rem; }
.next-tier-card p { margin: 5px 0 9px; color: rgba(255,255,255,.88); font-size: .76rem; font-weight: 700; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.12); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #43d491); box-shadow: 0 0 15px rgba(67,212,145,.32); transition: width .35s ease; }
.next-tier-card > small { display: block; margin-top: 6px; color: rgba(255,255,255,.5); font-size: .61rem; }
.next-tier-card.maxed { background: linear-gradient(135deg, rgba(28,160,103,.26), rgba(108,219,106,.16)); border-color: rgba(118,226,154,.32); }
.next-tier-card.maxed .progress-track span { background: #6fe29d; }

.tier-card, .breakdown-card { margin-top: 14px; border-radius: 16px; background: white; color: var(--text); padding: 16px; }
.tier-card { border: 1px solid transparent; transition: border-color .22s ease, box-shadow .22s ease; }
.tier-card.tier-earned { border-color: rgba(35, 150, 103, .34); box-shadow: 0 9px 24px rgba(35, 150, 103, .1); }
.tier-card.tier-earned .tier-step.active { background: #209664; border-color: #209664; box-shadow: 0 8px 18px rgba(32,150,100,.23); }
.tier-card-heading span, .breakdown-heading span { color: var(--ink); font-weight: 800; }
.tier-card-heading small, .breakdown-heading small { display: block; color: var(--muted); font-size: .65rem; margin-top: 2px; }
.tier-card-heading strong { color: var(--blue-strong); font-size: .82rem; }
.tier-ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 13px; }
.tier-step { text-align: center; border: 1px solid var(--line); background: var(--canvas); border-radius: 10px; padding: 9px 3px; }
.tier-step span, .tier-step small { display: block; }
.tier-step span { color: var(--ink); font-weight: 850; }
.tier-step small { color: var(--muted); margin-top: 2px; font-size: .55rem; }
.tier-step.active { background: var(--blue); border-color: var(--blue); box-shadow: 0 8px 18px rgba(7,155,221,.22); }
.tier-step.active span, .tier-step.active small { color: white; }

.breakdown-card dl { margin: 11px 0 0; }
.breakdown-card dl > div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid #e8f0f3; }
.breakdown-card dt { color: var(--text); }
.breakdown-card dt small { color: var(--muted); margin-left: 4px; }
.breakdown-card dd { margin: 0; color: var(--ink); font-weight: 800; }
.muted-row { opacity: .48; }
.breakdown-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; color: var(--ink); }
.breakdown-total span { font-weight: 800; }
.breakdown-total strong { color: var(--green); font-size: 1.35rem; }
.rule-strip { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 15px; color: rgba(255,255,255,.58); font-size: .65rem; }
.rule-strip > div { display: flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

.planning-dock { position: relative; z-index: 5; display: grid; gap: 9px; margin-top: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, #f9fcfd, #f0f8fb); }
.planning-dock-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px; }
.planning-dock-heading > div { display: flex; align-items: center; gap: 8px; }
.planning-dock-heading span { color: var(--blue-strong); font-size: .59rem; font-weight: 900; letter-spacing: .11em; }
.planning-dock-heading small { padding: 3px 7px; border-radius: 999px; color: var(--muted); background: white; font-size: .53rem; font-weight: 750; }
.planning-dock-heading p { margin: 0; color: var(--muted); font-size: .6rem; }
.planning-switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.planning-tool-button { min-width: 0; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; min-height: 60px; padding: 9px 11px; border: 1px solid #d7e6ec; border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.9); text-align: left; box-shadow: 0 4px 12px rgba(17,64,83,.04); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.planning-tool-button:hover, .planning-tool-button:focus-visible { transform: translateY(-1px); border-color: rgba(7,155,221,.42); box-shadow: 0 8px 18px rgba(7,91,127,.09); }
.planning-tool-button[aria-selected="true"] { border-color: rgba(7,155,221,.55); background: white; box-shadow: inset 0 0 0 1px rgba(7,155,221,.12), 0 9px 22px rgba(7,91,127,.1); }
.planning-tool-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--blue-strong); background: var(--blue-soft); font-size: 1rem; font-weight: 900; }
.planning-tool-button[aria-selected="true"] .planning-tool-icon { color: white; background: var(--blue); }
.planning-tool-button > span:nth-child(2) { min-width: 0; }
.planning-tool-button strong, .planning-tool-button small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.planning-tool-button strong { font-size: .76rem; }
.planning-tool-button small { margin-top: 2px; color: var(--muted); font-size: .59rem; }
.planning-tool-button i { color: var(--blue); font-size: 1.2rem; font-style: normal; transition: transform .2s ease; }
.planning-tool-button[aria-selected="true"] i { transform: rotate(90deg); }
.planning-tool-panel { position: absolute; z-index: 20; top: calc(100% + 9px); left: 10px; right: 10px; min-width: 0; padding: 16px; border: 1px solid rgba(7,155,221,.3); border-radius: 14px; background: white; box-shadow: 0 18px 42px rgba(17,64,83,.18); animation: planning-panel-in .24s ease both; }
.planning-tool-panel[hidden] { display: none; }
@keyframes planning-panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.planning-card > p { margin: 0 0 15px; color: var(--muted); font-size: .76rem; line-height: 1.52; }
.goal-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.goal-entry-heading label { color: var(--ink); font-size: .7rem; font-weight: 800; }
.goal-entry-heading span { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: .61rem; font-weight: 750; }
.goal-entry-heading i { width: 6px; height: 6px; border-radius: 50%; background: #21b477; box-shadow: 0 0 0 4px rgba(33,180,119,.11); }
.goal-controls { display: block; }
.number-shell.goal-number { min-height: 42px; }
.number-shell.goal-number input { width: 100%; font-size: 1rem; }
.primary-button, .quiet-button { min-height: 42px; border-radius: 11px; padding: 9px 14px; font-size: .76rem; font-weight: 850; }
.primary-button { color: white; border: 1px solid var(--blue); background: var(--blue); box-shadow: 0 8px 18px rgba(7,155,221,.16); }
.primary-button:hover, .primary-button:focus-visible { background: var(--blue-strong); border-color: var(--blue-strong); }
.quiet-button { color: var(--muted); border: 1px solid var(--line); background: white; }
.quiet-button:hover, .quiet-button:focus-visible { color: var(--ink); background: var(--canvas); }
.goal-result { margin-top: 13px; padding: 14px; border: 1px solid rgba(29,166,108,.24); border-radius: 13px; background: linear-gradient(135deg, rgba(35,180,119,.09), rgba(7,155,221,.07)); }
.goal-result.achieved { border-color: rgba(29,166,108,.42); background: rgba(35,180,119,.12); }
.goal-result.unreachable { border-color: rgba(218,127,45,.38); background: rgba(255,161,65,.1); }
.goal-result-label { color: var(--green); font-size: .58rem; font-weight: 900; letter-spacing: .11em; }
.goal-result-numbers { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin: 4px 0; color: var(--ink); }
.goal-result-numbers strong { font-size: 1.08rem; }
.goal-result-numbers i { color: var(--muted); font-style: normal; font-size: .72rem; }
.goal-result p { margin: 0; color: var(--text); font-size: .72rem; line-height: 1.45; }
.scenario-actions { display: flex; gap: 8px; }
.scenario-empty { display: grid; place-items: center; min-height: 92px; margin-top: 13px; padding: 14px; border: 1px dashed #bfd4dc; border-radius: 13px; color: var(--muted); background: rgba(237,246,249,.5); text-align: center; font-size: .74rem; }
.scenario-comparison { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; margin-top: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.scenario-comparison[hidden] { display: none; }
.scenario-column { min-width: 0; }
.scenario-column span { display: block; color: var(--muted); font-size: .56rem; font-weight: 850; letter-spacing: .08em; }
.scenario-column strong { display: block; margin: 3px 0; color: var(--ink); font-size: 1.05rem; }
.scenario-column small { display: block; overflow: hidden; color: var(--muted); font-size: .62rem; line-height: 1.35; text-overflow: ellipsis; }
.scenario-column.target strong { color: var(--blue-strong); }
.scenario-arrow { color: var(--blue); font-weight: 900; }
.scenario-delta { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid #e7eff2; color: var(--green); text-align: center; font-size: .7rem; font-weight: 850; }
.scenario-delta.negative { color: #c34b55; }

.mobile-pay-bar { display: none; }
.share-preview { width: min(920px, calc(100% - 30px)); max-height: calc(100vh - 30px); margin: auto; padding: 18px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: white; box-shadow: 0 28px 90px rgba(5,25,36,.28); }
.share-preview::backdrop { background: rgba(6,25,35,.68); backdrop-filter: blur(5px); }
.share-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.share-preview-heading h2 { margin: 3px 0 0; color: var(--ink); font-size: 1.25rem; }
.share-preview-heading button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--canvas); font-size: 1.3rem; }
.share-preview img { display: block; width: 100%; height: auto; border-radius: 13px; background: #0d2431; }
.share-preview-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
.share-preview-actions span { color: var(--muted); font-size: .75rem; }
.share-preview-actions a { border-radius: 11px; color: white; background: var(--blue); padding: 10px 15px; text-decoration: none; font-size: .76rem; font-weight: 850; }

.tier-reference { margin: 22px 0 0; background: white; border: 1px solid var(--line); padding: 24px; display: grid; grid-template-columns: .6fr 1.4fr; gap: 30px; align-items: center; }
.tier-table { display: grid; gap: 4px; }
.tier-table-row { display: grid; grid-template-columns: .7fr 1fr 1fr; align-items: center; gap: 10px; border-radius: 9px; background: var(--canvas); padding: 8px 12px; font-size: .78rem; }
.tier-table-row.header { color: var(--muted); background: transparent; padding-top: 0; padding-bottom: 2px; font-size: .65rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.tier-table-row strong { color: var(--blue-strong); }

footer { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; padding: 24px 2px 30px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; color: white; background: var(--ink); border-radius: 999px; padding: 10px 16px; font-size: .78rem; font-weight: 750; transition: .25s ease; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.celebration { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.money-piece { position: absolute; left: 50%; top: 42%; color: var(--piece-color, #139b5f); font-size: var(--size); font-weight: 950; line-height: 1; text-shadow: 0 3px 10px color-mix(in srgb, var(--piece-color, #139b5f) 42%, transparent); animation: money-pop 1050ms cubic-bezier(.12,.72,.18,1) forwards; }
.money-piece.celebration-christmas { filter: drop-shadow(0 0 7px var(--piece-color)); }
.money-piece.celebration-newyear { filter: drop-shadow(0 0 9px var(--piece-color)); }
.money-piece.celebration-valentine { font-family: Georgia, serif; }
@keyframes money-pop { 0% { transform: translate(-50%, -50%) scale(.35); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--spin)) scale(1.15); opacity: 0; } }
.spooky-decor { display: none; pointer-events: none; }
.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; }

body.halloween {
  --blue: #ff7a00;
  --blue-strong: #ff9a36;
  --blue-soft: #2f193a;
  --ink: #fff5e7;
  --text: #f2e7ef;
  --muted: #c6b4ca;
  --line: #5a3e61;
  --card: #1a1022;
  --canvas: #0c0711;
  --green: #a2f46c;
  --shadow: 0 20px 60px rgba(0,0,0,.4);
  background:
    radial-gradient(circle at 12% 6%, rgba(255,103,0,.24), transparent 28rem),
    radial-gradient(circle at 90% 32%, rgba(117,36,155,.24), transparent 30rem),
    linear-gradient(160deg, #09050d, #190a24 55%, #060408);
}
body.halloween::before { content: ""; position: fixed; inset: 0; z-index: -1; opacity: .14; background: repeating-radial-gradient(circle at 100% 0, transparent 0 31px, #ff8b27 32px 33px, transparent 34px 55px); }
body.halloween .brand { display: grid; place-items: center; padding: 7px; border-radius: 14px; background: rgba(255,255,255,.9); box-shadow: 0 0 24px rgba(255,126,25,.2); }
body.halloween .brand img { filter: drop-shadow(0 0 9px rgba(255,126,25,.38)) grayscale(.12); }
body.halloween .halloween-button { color: #16061d; border-color: #ff9a36; background: #ff8a18; box-shadow: 0 0 22px rgba(255,113,0,.35); }
body.halloween .sound-button { color: #c7a7d3; border-color: rgba(199,91,255,.24); background: rgba(34,10,44,.42); }
body.halloween .sound-button[aria-pressed="true"] { color: #b9ff62; background: rgba(185,255,98,.09); border-color: rgba(185,255,98,.32); }
body.halloween .live-pill { color: #f6c6ff; border-color: rgba(199,91,255,.42); background: rgba(34,10,44,.68); }
body.halloween .live-pill span { background: #b9ff62; box-shadow: 0 0 0 5px rgba(185,255,98,.12), 0 0 16px #b9ff62; }
body.halloween .controls-panel, body.halloween .tier-reference { background: linear-gradient(145deg, rgba(30,16,39,.97), rgba(16,9,22,.97)); border-color: #55335e; }
body.halloween .control-card { background: #211429; border-color: #5a3e61; }
body.halloween .control-card:focus-within { background: #2a1733; border-color: #ff8b27; }
body.halloween .number-shell { background: #100918; border-color: #65456d; }
body.halloween .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--range-color, #ff7a00) var(--fill), #493450 var(--fill)); }
body.halloween .range::-moz-range-track { background: #493450; }
body.halloween .results-panel { background: linear-gradient(155deg, #18091f, #07040a 62%, #1c0d05); border: 1px solid rgba(255,130,31,.32); }
body.halloween .metric { background: rgba(111,54,126,.18); border-color: rgba(212,127,235,.18); }
body.halloween .metric.metric-success { background: rgba(123,190,69,.14); border-color: rgba(169,244,108,.28); }
body.halloween .next-tier-card { background: linear-gradient(135deg, rgba(255,115,0,.18), rgba(129,47,156,.22)); border-color: rgba(255,148,61,.25); }
body.halloween .share-card-button { color: #18091f; background: #ff9a36; }
body.halloween .planning-dock { background: linear-gradient(145deg, #211429, #180f1e); border-color: #51365a; }
body.halloween .planning-dock-heading small { color: #c6b4ca; background: #2a1932; }
body.halloween .planning-tool-button { color: #fff0df; background: #211429; border-color: #51365a; }
body.halloween .planning-tool-button[aria-selected="true"] { border-color: rgba(255,141,38,.55); background: #2a1932; }
body.halloween .planning-tool-icon { color: #ffad50; background: rgba(255,141,38,.12); }
body.halloween .planning-tool-button[aria-selected="true"] .planning-tool-icon, body.halloween .primary-button { color: #17071d; background: #ff8d26; border-color: #ff8d26; }
body.halloween .planning-tool-panel { background: #211429; border-color: #5a3e61; }
body.halloween .goal-result { background: linear-gradient(135deg, rgba(255,113,0,.12), rgba(158,63,184,.14)); border-color: rgba(255,149,62,.26); }
body.halloween .scenario-empty, body.halloween .scenario-comparison { color: var(--muted); background: #180f1e; border-color: #51365a; }
body.halloween .scenario-column strong { color: #fff0df; }
body.halloween .scenario-column.target strong { color: #ffad50; }
body.halloween .scenario-delta { border-top-color: #39263f; color: #a2f46c; }
body.halloween .mobile-pay-bar { background: rgba(24,9,31,.96); border-color: rgba(255,130,31,.35); }
body.halloween .share-preview { color: var(--text); background: #180f1e; border-color: #51365a; }
body.halloween .share-preview-heading h2 { color: #fff0df; }
body.halloween .recovery-card { border-color: rgba(255,122,0,.44); background: linear-gradient(135deg, rgba(255,88,0,.23), rgba(125,38,151,.22)); box-shadow: inset 3px 0 0 #ff7518; }
body.halloween .recovery-topline span, body.halloween .recovery-topline strong, body.halloween .recovery-comparison i { color: #ffad50; }
body.halloween .next-tier-heading strong { color: #ffb35f; }
body.halloween .progress-track span { background: linear-gradient(90deg, #ff6a00, #c85cff); }
body.halloween .tier-card, body.halloween .breakdown-card { background: #180f1e; border: 1px solid #51365a; }
body.halloween .tier-step { background: #29172f; border-color: #593c61; }
body.halloween .tier-card.tier-earned .tier-step.active, body.halloween .tier-step.active { background: linear-gradient(145deg, #ff7417, #a33bbf); border-color: #ff963f; box-shadow: 0 8px 22px rgba(255,104,0,.25); }
body.halloween .breakdown-card dl > div { border-bottom-color: #39263f; }
body.halloween .breakdown-card dt, body.halloween .breakdown-card dd, body.halloween .breakdown-total, body.halloween .tier-card-heading span, body.halloween .breakdown-heading span { color: #fff0df; }
body.halloween .breakdown-total strong { color: #a2f46c; }
body.halloween .tier-table-row { background: #23142b; }
body.halloween .tier-table-row.header { background: transparent; }
body.halloween .text-button { color: #18091f; background: #ff8d26; }
body.halloween .spooky-decor { display: block; position: fixed; inset: 0; z-index: 40; overflow: hidden; }
body.halloween .spooky-decor span { position: absolute; filter: drop-shadow(0 5px 10px rgba(0,0,0,.55)); animation: spooky-float 4.5s ease-in-out infinite; }
body.halloween .spooky-decor span:nth-child(1) { top: 8%; left: 2%; font-size: 2rem; }
body.halloween .spooky-decor span:nth-child(2) { top: 24%; right: 2%; font-size: 2.4rem; animation-delay: -.8s; }
body.halloween .spooky-decor span:nth-child(3) { bottom: 5%; left: 4%; font-size: 2.3rem; animation-delay: -1.6s; }
body.halloween .spooky-decor span:nth-child(4) { top: 2%; right: 17%; font-size: 2.8rem; animation-delay: -2.2s; }
body.halloween .spooky-decor span:nth-child(5) { bottom: 12%; right: 3%; font-size: 1.8rem; animation-delay: -3s; }
@keyframes spooky-float { 50% { transform: translateY(-12px) rotate(5deg); } }

@media (max-width: 900px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .controls-panel, .results-panel { grid-column: 1; grid-row: auto; z-index: auto; }
  .results-panel { position: relative; top: auto; }
  .planning-dock { z-index: auto; }
  .planning-tool-panel { position: static; margin-top: 0; }
  .tier-reference { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 20px, 580px); }
  .site-header { grid-template-columns:auto minmax(0,1fr) auto; gap:10px; padding:14px 0 16px; }
  .brand { width:82px; height:56px; border-radius:12px; }
  .brand img { width:76px; max-height:52px; }
  .brand img.seasonal-logo { width:76px; max-height:52px; }
  .header-copy h1 { margin-top:2px; font-size:1.42rem; line-height:1; }
  .header-copy p { margin-top:3px; font-size:.7rem; line-height:1.25; }
  .header-copy .eyebrow { font-size:.56rem; letter-spacing:.11em; }
  .header-actions { justify-content:flex-end; }
  .controls-panel, .results-panel { padding: 20px; }
  .results-topline { align-items: flex-start; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .result-actions button { padding: 7px 10px; font-size: .68rem; }
  .control-row { grid-template-columns: 1fr; }
  .control-heading { align-items: flex-start; }
  .planning-dock { padding: 9px; }
  .planning-dock-heading p, .planning-dock-heading small { display: none; }
  .planning-tool-button { grid-template-columns: 30px 1fr auto; min-height: 54px; padding: 8px; gap: 7px; }
  .planning-tool-icon { width: 30px; height: 30px; }
  .planning-tool-button small { display: none; }
  .planning-tool-panel { padding: 14px; }
  .goal-controls { grid-template-columns: 1fr; }
  .scenario-comparison { grid-template-columns: 1fr; text-align: center; }
  .scenario-arrow { transform: rotate(90deg); }
  .mobile-pay-bar { position: fixed; z-index: 70; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 11px 10px 15px; border: 1px solid rgba(7,155,221,.2); border-radius: 16px; color: white; background: rgba(15,32,43,.95); box-shadow: 0 14px 38px rgba(7,25,35,.28); backdrop-filter: blur(12px); }
  .mobile-pay-bar div span, .mobile-pay-bar div strong { display: block; }
  .mobile-pay-bar div span { color: rgba(255,255,255,.62); font-size: .6rem; }
  .mobile-pay-bar div strong { margin-top: 1px; font-size: 1.05rem; }
  .mobile-pay-bar button { border: 0; border-radius: 11px; color: #062b3d; background: #8edfff; padding: 9px 11px; font-size: .68rem; font-weight: 850; }
  .mobile-pay-bar .mobile-pay-actions { display: flex; flex-direction: row; align-items: center; gap: 6px; }
  .mobile-pay-bar .mobile-reset-button { color: rgba(255,255,255,.82); background: rgba(255,255,255,.1); }
  body { padding-bottom: 82px; }
  .tier-reference { padding: 20px; }
  footer { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .cpa-card.under-stress, .cpa-card.broken, .spooky-decor span, .money-piece { animation: none !important; }
  .recovery-card { animation: none !important; }
}

/* Centralized app themes */
:root,
html[data-theme="ams"] {
  --page-background: radial-gradient(circle at 8% 4%, rgba(7,155,221,.11), transparent 28rem), linear-gradient(180deg, #f9fcfd 0, #f3f8fb 70%, #eef6f9 100%);
  --blue: #079bdd;
  --blue-strong: #007db7;
  --blue-soft: #e8f6fb;
  --ink: #0e1b24;
  --text: #2c3d48;
  --muted: #6c7e89;
  --line: #d7e5eb;
  --card: #ffffff;
  --canvas: #f3f8fb;
  --surface-soft: #fbfdfe;
  --surface-raised: #ffffff;
  --surface-translucent: rgba(255,255,255,.78);
  --range-track: #dbe9ef;
  --green: #13855d;
  --green-soft: #e9f7f1;
  --result-bg: #0f202b;
  --result-ink: #ffffff;
  --result-muted: rgba(255,255,255,.66);
  --result-card: #ffffff;
  --result-card-ink: #2c3d48;
  --result-card-muted: #6c7e89;
  --result-tint: rgba(255,255,255,.075);
  --result-border: rgba(255,255,255,.12);
  --logo-surface: rgba(255,255,255,.74);
  --focus-ring: rgba(7,155,221,.34);
  --shadow: 0 18px 50px rgba(14,38,52,.09);
}

html[data-theme="light"] {
  --page-background: linear-gradient(180deg, #f8fafc, #eef2f7);
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --blue-soft: #e8efff;
  --ink: #111827;
  --text: #334155;
  --muted: #64748b;
  --line: #d8e0ea;
  --card: #ffffff;
  --canvas: #f1f5f9;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --surface-translucent: rgba(255,255,255,.86);
  --range-track: #dbe3ee;
  --green: #0f8a5f;
  --green-soft: #e7f7f0;
  --result-bg: #172033;
  --result-ink: #ffffff;
  --result-muted: #b7c2d0;
  --result-card: #ffffff;
  --result-card-ink: #273449;
  --result-card-muted: #64748b;
  --result-tint: rgba(255,255,255,.07);
  --result-border: rgba(255,255,255,.12);
  --logo-surface: #ffffff;
  --focus-ring: rgba(37,99,235,.35);
}

html[data-theme="dark"] {
  --page-background: radial-gradient(circle at 10% 0, rgba(56,189,248,.1), transparent 28rem), linear-gradient(180deg, #111827, #0b1220);
  --blue: #38bdf8;
  --blue-strong: #7dd3fc;
  --blue-soft: #173248;
  --ink: #f8fafc;
  --text: #d5deea;
  --muted: #94a3b8;
  --line: #344256;
  --card: #172033;
  --canvas: #0f172a;
  --surface-soft: #1d293b;
  --surface-raised: #202d40;
  --surface-translucent: rgba(23,32,51,.88);
  --range-track: #3b4a5f;
  --green: #5ee2a0;
  --green-soft: #173b31;
  --result-bg: #080f1c;
  --result-ink: #ffffff;
  --result-muted: #9fb0c5;
  --result-card: #172033;
  --result-card-ink: #eef4fb;
  --result-card-muted: #9fb0c5;
  --result-tint: rgba(255,255,255,.07);
  --result-border: #344256;
  --logo-surface: rgba(255,255,255,.92);
  --focus-ring: rgba(56,189,248,.42);
  --shadow: 0 20px 55px rgba(0,0,0,.28);
}

html[data-theme="midnight"] {
  --page-background: radial-gradient(circle at 80% 0, rgba(37,168,222,.15), transparent 32rem), linear-gradient(165deg, #06172b, #03101e 72%);
  --blue: #27b4ef;
  --blue-strong: #78d8ff;
  --blue-soft: #103a57;
  --ink: #f4f9ff;
  --text: #d1e0ee;
  --muted: #86a2ba;
  --line: #254a67;
  --card: #0b2740;
  --canvas: #061b30;
  --surface-soft: #0f304c;
  --surface-raised: #123752;
  --surface-translucent: rgba(11,39,64,.9);
  --range-track: #31556e;
  --green: #63e6b2;
  --green-soft: #123d36;
  --result-bg: #03111f;
  --result-ink: #f7fbff;
  --result-muted: #91abc1;
  --result-card: #0b2740;
  --result-card-ink: #eef8ff;
  --result-card-muted: #91abc1;
  --result-tint: rgba(39,180,239,.09);
  --result-border: #254a67;
  --logo-surface: rgba(255,255,255,.94);
  --focus-ring: rgba(39,180,239,.46);
  --shadow: 0 24px 62px rgba(0,0,0,.36);
}

html[data-theme="degenerate"] {
  --page-background: radial-gradient(circle at 10% -5%, rgba(0,169,214,.16), transparent 28rem), radial-gradient(circle at 94% 8%, rgba(15,169,111,.15), transparent 26rem), linear-gradient(160deg, #eef8f5 0%, #e3f2ee 52%, #d9ebe7 100%);
  --blue: #00a9d6;
  --blue-strong: #087e9d;
  --blue-soft: #e1f7fb;
  --ink: #102a32;
  --text: #36545c;
  --muted: #5f7880;
  --line: #b9d5cf;
  --card: #ffffff;
  --canvas: #dceeea;
  --surface-soft: #eaf6f3;
  --surface-raised: #ffffff;
  --surface-translucent: rgba(255,255,255,.92);
  --range-track: #c9e1db;
  --green: #0fa96f;
  --green-soft: #e0f7ed;
  --result-bg: linear-gradient(145deg, #ffffff, #eef9f6 60%, #e4f4ef);
  --result-ink: #102a32;
  --result-muted: #668087;
  --result-card: #ffffff;
  --result-card-ink: #102a32;
  --result-card-muted: #708a91;
  --result-tint: rgba(15,169,111,.055);
  --result-border: #b7d5cd;
  --logo-surface: #ffffff;
  --focus-ring: rgba(0,169,214,.42);
  --shadow: 0 24px 62px rgba(20,69,63,.17), 0 0 0 1px rgba(0,169,214,.06);
}

html[data-theme="goat"] {
  --page-background: radial-gradient(circle at 12% 0, rgba(255,219,91,.24), transparent 30rem), radial-gradient(circle at 92% 16%, rgba(165,104,10,.2), transparent 28rem), linear-gradient(160deg, #171108, #2a1d08 54%, #0f0c07);
  --blue: #d7a72c;
  --blue-strong: #9c6514;
  --blue-soft: #fff1b8;
  --ink: #2a1d08;
  --text: #4d3a16;
  --muted: #806a3c;
  --line: #dac27d;
  --card: #fffaf0;
  --canvas: #2a1d08;
  --surface-soft: #fff4cf;
  --surface-raised: #fffdf6;
  --surface-translucent: rgba(255,250,240,.92);
  --range-track: #eadba9;
  --green: #9c6514;
  --green-soft: #fff0b5;
  --result-bg: linear-gradient(145deg, #120e08, #2f210b 58%, #181006);
  --result-ink: #fff8dc;
  --result-muted: #d9c99a;
  --result-card: #fff9e7;
  --result-card-ink: #2a1d08;
  --result-card-muted: #806a3c;
  --result-tint: rgba(247,211,103,.1);
  --result-border: rgba(247,211,103,.35);
  --logo-surface: rgba(255,251,236,.96);
  --focus-ring: rgba(215,167,44,.5);
  --shadow: 0 24px 64px rgba(5,3,0,.34), 0 0 0 1px rgba(247,211,103,.12);
}

html[data-theme="contrast"] {
  --page-background: #000000;
  --blue: #ffe900;
  --blue-strong: #ffe900;
  --blue-soft: #2b2800;
  --ink: #ffffff;
  --text: #ffffff;
  --muted: #f1f1f1;
  --line: #ffffff;
  --card: #000000;
  --canvas: #000000;
  --surface-soft: #111111;
  --surface-raised: #161616;
  --surface-translucent: #000000;
  --range-track: #ffffff;
  --green: #67ff8a;
  --green-soft: #002d0c;
  --result-bg: #000000;
  --result-ink: #ffffff;
  --result-muted: #ffffff;
  --result-card: #000000;
  --result-card-ink: #ffffff;
  --result-card-muted: #ffffff;
  --result-tint: #111111;
  --result-border: #ffffff;
  --logo-surface: #ffffff;
  --focus-ring: #ffe900;
  --shadow: 0 0 0 2px #ffffff;
}

html[data-theme="halloween"] {
  --season-accent: linear-gradient(90deg, #ff7a00, #b968ff, #ff7a00);
  --page-background: radial-gradient(circle at 8% 4%, rgba(255,122,0,.2), transparent 27rem), radial-gradient(circle at 92% 24%, rgba(147,51,234,.16), transparent 30rem), linear-gradient(160deg, #0d0712, #1b0b24 60%, #08050c);
  --blue: #ff7a00;
  --blue-strong: #ffab55;
  --blue-soft: #3b203f;
  --ink: #fff7e9;
  --text: #f3e8f4;
  --muted: #c9b5cd;
  --line: #5a3e61;
  --card: #1c1124;
  --canvas: #0d0712;
  --surface-soft: #25152d;
  --surface-raised: #2a1833;
  --surface-translucent: rgba(28,17,36,.9);
  --range-track: #4c3654;
  --green: #a8f56e;
  --green-soft: #253c20;
  --result-bg: #100817;
  --result-ink: #fff7e9;
  --result-muted: #cfb9d1;
  --result-card: #1c1124;
  --result-card-ink: #fff7e9;
  --result-card-muted: #cfb9d1;
  --result-tint: rgba(255,122,0,.09);
  --result-border: #5a3e61;
  --logo-surface: rgba(255,255,255,.92);
  --focus-ring: rgba(255,122,0,.48);
  --shadow: 0 24px 60px rgba(0,0,0,.38);
}

html[data-theme="christmas"] {
  --season-accent: linear-gradient(90deg, #ba1f3b, #e7c84d, #13704d, #ba1f3b);
  --page-background: radial-gradient(circle at 8% 0, rgba(187,29,51,.1), transparent 25rem), linear-gradient(180deg, #f6fbf8, #eaf4ed);
  --blue: #ba1f3b;
  --blue-strong: #94142d;
  --blue-soft: #fde9ed;
  --ink: #123128;
  --text: #314d44;
  --muted: #657c74;
  --line: #cbded4;
  --card: #ffffff;
  --canvas: #edf6f1;
  --surface-soft: #f8fcf9;
  --surface-raised: #ffffff;
  --surface-translucent: rgba(255,255,255,.88);
  --range-track: #d4e5db;
  --green: #13704d;
  --green-soft: #e2f3e9;
  --result-bg: #0d3b2e;
  --result-ink: #ffffff;
  --result-muted: #c4ddd3;
  --result-card: #ffffff;
  --result-card-ink: #173b30;
  --result-card-muted: #657c74;
  --result-tint: rgba(255,255,255,.08);
  --result-border: rgba(255,255,255,.16);
  --logo-surface: #ffffff;
  --focus-ring: rgba(186,31,59,.38);
}

html[data-theme="thanksgiving"] {
  --season-accent: linear-gradient(90deg, #944019, #d8a13a, #647334, #c65d21);
  --page-background: radial-gradient(circle at 8% 0, rgba(205,103,38,.14), transparent 26rem), linear-gradient(180deg, #fff9ee, #f4e7d4);
  --blue: #c65d21;
  --blue-strong: #944019;
  --blue-soft: #f9e2cf;
  --ink: #3d2418;
  --text: #5b4032;
  --muted: #856b5c;
  --line: #dfc8b4;
  --card: #fffdf8;
  --canvas: #f6eadb;
  --surface-soft: #fff8ef;
  --surface-raised: #fffdf8;
  --surface-translucent: rgba(255,253,248,.9);
  --range-track: #e6d2bf;
  --green: #647334;
  --green-soft: #eef1de;
  --result-bg: #512b1a;
  --result-ink: #fffaf2;
  --result-muted: #e6cbbb;
  --result-card: #fffaf2;
  --result-card-ink: #4a2b1c;
  --result-card-muted: #856b5c;
  --result-tint: rgba(255,200,130,.09);
  --result-border: rgba(255,255,255,.16);
  --logo-surface: #ffffff;
  --focus-ring: rgba(198,93,33,.4);
}

html[data-theme="newyear"] {
  --season-accent: linear-gradient(90deg, #e2be5a, #ffffff, #8edfff, #e2be5a);
  --page-background: radial-gradient(circle at 50% -10%, rgba(226,190,90,.16), transparent 29rem), linear-gradient(180deg, #07111f, #020711);
  --blue: #e2be5a;
  --blue-strong: #f4d879;
  --blue-soft: #342f20;
  --ink: #fff9e5;
  --text: #e7e3d7;
  --muted: #aaa89f;
  --line: #4b4b47;
  --card: #111b2a;
  --canvas: #07111f;
  --surface-soft: #182334;
  --surface-raised: #1d293a;
  --surface-translucent: rgba(17,27,42,.9);
  --range-track: #465064;
  --green: #72e6b2;
  --green-soft: #183a32;
  --result-bg: #030914;
  --result-ink: #fff9e5;
  --result-muted: #b7b6af;
  --result-card: #111b2a;
  --result-card-ink: #fff9e5;
  --result-card-muted: #b7b6af;
  --result-tint: rgba(226,190,90,.08);
  --result-border: #4b4b47;
  --logo-surface: rgba(255,255,255,.94);
  --focus-ring: rgba(226,190,90,.48);
  --shadow: 0 24px 62px rgba(0,0,0,.4);
}

html[data-theme="valentine"] {
  --season-accent: linear-gradient(90deg, #ad2858, #f08fb1, #ffffff, #d73e72);
  --page-background: radial-gradient(circle at 10% 0, rgba(231,86,133,.16), transparent 26rem), linear-gradient(180deg, #fff7fa, #f9e6ed);
  --blue: #d73e72;
  --blue-strong: #ad2858;
  --blue-soft: #fce6ee;
  --ink: #3a1726;
  --text: #5b3342;
  --muted: #866575;
  --line: #e5c7d3;
  --card: #fffdfd;
  --canvas: #faedf2;
  --surface-soft: #fff7fa;
  --surface-raised: #fffdfd;
  --surface-translucent: rgba(255,253,253,.9);
  --range-track: #ead3dc;
  --green: #398966;
  --green-soft: #e5f4ee;
  --result-bg: #671e3c;
  --result-ink: #fff8fb;
  --result-muted: #eac6d4;
  --result-card: #fff8fb;
  --result-card-ink: #4a1e31;
  --result-card-muted: #866575;
  --result-tint: rgba(255,255,255,.09);
  --result-border: rgba(255,255,255,.17);
  --logo-surface: #ffffff;
  --focus-ring: rgba(215,62,114,.4);
}

html[data-theme="party"] {
  --season-accent: linear-gradient(90deg,#8b5cf6,#22d3ee,#f472b6,#facc15,#34d399,#8b5cf6);
  --page-background: radial-gradient(circle at 8% 4%,rgba(139,92,246,.22),transparent 29rem),radial-gradient(circle at 92% 10%,rgba(34,211,238,.2),transparent 30rem),linear-gradient(155deg,#120c2a,#23114a 55%,#0d1f38);
  --blue:#8b5cf6; --blue-strong:#c4b5fd; --blue-soft:#332261;
  --ink:#fff; --text:#eee9ff; --muted:#bdb3df; --line:#58478b;
  --card:#25183f; --canvas:#160e2a; --surface-soft:#2e1f4d; --surface-raised:#38265d; --surface-translucent:rgba(37,24,63,.9);
  --range-track:#514071; --green:#34d399; --green-soft:#173f38;
  --result-bg:linear-gradient(145deg,#100924,#271147 58%,#092a3b); --result-ink:#fff; --result-muted:#c8bde8;
  --result-card:#2e1f4d; --result-card-ink:#fff; --result-card-muted:#bdb3df; --result-tint:rgba(255,255,255,.075); --result-border:#58478b;
  --logo-surface:rgba(255,255,255,.96); --focus-ring:rgba(34,211,238,.44); --shadow:0 24px 64px rgba(4,2,17,.4),0 0 0 1px rgba(139,92,246,.16);
}

html[data-theme="birthday"] {
  --season-accent:linear-gradient(90deg,#ec4899,#8b5cf6,#22d3ee,#facc15,#ec4899);
  --page-background:radial-gradient(circle at 10% 0,rgba(236,72,153,.18),transparent 28rem),radial-gradient(circle at 90% 12%,rgba(34,211,238,.16),transparent 29rem),linear-gradient(160deg,#fff7fd,#f2edff 55%,#eafaff);
  --blue:#db2777; --blue-strong:#a9165b; --blue-soft:#fde6f2;
  --ink:#351337; --text:#61405f; --muted:#8c7088; --line:#ddc7dc;
  --card:#fffaff; --canvas:#f4ebfa; --surface-soft:#fff2fa; --surface-raised:#fff; --surface-translucent:rgba(255,250,255,.9);
  --range-track:#ead9eb; --green:#0f9f79; --green-soft:#e2f7f0;
  --result-bg:linear-gradient(145deg,#4e174d,#7a1d62 58%,#243865); --result-ink:#fff; --result-muted:#efd7ed;
  --result-card:#fff8fd; --result-card-ink:#3c173d; --result-card-muted:#8c7088; --result-tint:rgba(255,255,255,.1); --result-border:rgba(255,255,255,.18);
  --logo-surface:#fff; --focus-ring:rgba(219,39,119,.38); --shadow:0 22px 60px rgba(96,33,104,.16);
}

body { color: var(--text); background: var(--page-background); transition: color .22s ease, background .3s ease; }
body.settings-open { overflow: hidden; }
.header-copy h1, .section-heading h2, .tier-reference h2 { color: var(--ink); }
.brand { padding: 6px; border-radius: 14px; background: var(--logo-surface); box-shadow: 0 7px 22px rgba(0,0,0,.05); }
.live-pill { color: var(--blue-strong); border-color: color-mix(in srgb, var(--blue) 28%, transparent); background: var(--surface-translucent); }
.controls-panel, .tier-reference { color: var(--text); background: var(--card); border-color: var(--line); }
.control-card { color: var(--text); background: var(--surface-soft); border-color: var(--line); }
.control-card:focus-within { background: var(--surface-raised); border-color: var(--blue); }
.number-shell, .quiet-button { color: var(--ink); background: var(--surface-raised); border-color: var(--line); }
.number-shell input, .control-heading label { color: var(--ink); }
.range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--range-color, var(--blue)) var(--fill), var(--range-track) var(--fill)); }
.range::-moz-range-track { background: var(--range-track); }
.range::-webkit-slider-thumb, .range::-moz-range-thumb { background: var(--surface-raised); }
.planning-dock { position: relative; z-index: 5; background: var(--surface-soft); border-color: var(--line); }
.planning-dock-heading small, .planning-tool-button, .planning-tool-panel { background: var(--surface-raised); }
.planning-tool-button, .planning-tool-panel { color: var(--text); border-color: var(--line); }
.planning-tool-button[aria-selected="true"] { background: var(--surface-raised); border-color: var(--blue); }
.planning-tool-panel { position: static; min-height: 278px; margin-top: 0; box-shadow: 0 11px 24px rgba(17,64,83,.08); }
.goal-result, .scenario-comparison { background-color: var(--surface-raised); }
.scenario-empty { background: var(--canvas); border-color: var(--line); }
.tier-reference, .share-preview { background: var(--card); border-color: var(--line); }
.tier-table-row { color: var(--text); background: var(--canvas); }
.tier-table-row.header { background: transparent; }
footer { color: var(--muted); }

.results-panel { color: var(--result-ink); background: var(--result-bg); }
.total-block > span, .total-block small, .metric span, .metric small, .rule-strip { color: var(--result-muted); }
.metric { background: var(--result-tint); border-color: var(--result-border); }
.metric strong, .next-tier-card, .recovery-card { color: var(--result-ink); }
.next-tier-card { background: var(--result-tint); border-color: var(--result-border); }
.next-tier-card p { color: var(--result-ink); }
.next-tier-card > small { color: var(--result-muted); }
.tier-card, .breakdown-card { color: var(--result-card-ink); background: var(--result-card); border-color: var(--result-border); }
.tier-card-heading span, .breakdown-heading span, .breakdown-card dd, .breakdown-total { color: var(--result-card-ink); }
.tier-card-heading small, .breakdown-heading small, .breakdown-card dt, .breakdown-card dt small, .tier-step small { color: var(--result-card-muted); }
.breakdown-card dl > div { border-bottom-color: color-mix(in srgb, var(--result-card-muted) 18%, transparent); }
.tier-step { background: color-mix(in srgb, var(--result-card) 78%, var(--canvas)); border-color: color-mix(in srgb, var(--result-card-muted) 24%, transparent); }
.tier-step span { color: var(--result-card-ink); }
.tier-step.active, .tier-card.tier-earned .tier-step.active { color: white; background: var(--blue); border-color: var(--blue); }
.tier-step.active span, .tier-step.active small { color: white; }
.breakdown-total strong { color: var(--green); }

html[data-theme="contrast"] button,
html[data-theme="contrast"] input,
html[data-theme="contrast"] .control-card,
html[data-theme="contrast"] .settings-section,
html[data-theme="contrast"] .results-panel { border-width: 2px; }

.settings-button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: 999px; color: var(--blue-strong); background: var(--surface-translucent); font-size: .73rem; font-weight: 800; }
.settings-button svg { width: 17px; height: 17px; fill: currentColor; }
.settings-button:hover, .settings-button:focus-visible { transform: translateY(-1px); background: var(--blue-soft); }

.settings-overlay { position: fixed; inset: 0; z-index: 240; display: flex; justify-content: flex-end; background: rgba(4,15,23,.42); opacity: 0; transition: opacity .24s ease; }
.settings-overlay[hidden] { display: none; }
.settings-overlay.open { opacity: 1; }
.settings-panel { width: min(455px, 100%); height: 100%; overflow: hidden; color: var(--text); background: var(--card); border-left: 1px solid var(--line); box-shadow: -24px 0 70px rgba(0,0,0,.2); transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.settings-overlay.open .settings-panel { transform: translateX(0); }
.settings-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 24px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.settings-panel-header h2 { margin: 4px 0 4px; color: var(--ink); font-size: 1.55rem; letter-spacing: -.035em; }
.settings-panel-header p { margin: 0; color: var(--muted); font-size: .76rem; }
.settings-close-button { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface-raised); font-size: 1.35rem; }
.settings-panel-content { height: calc(100% - 105px); overflow-y: auto; padding: 18px 20px 32px; overscroll-behavior: contain; }
.settings-section { margin-bottom: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); }
.settings-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.settings-section-heading > div { display: flex; align-items: center; gap: 9px; }
.settings-section-heading > div > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: white; background: var(--blue); font-size: .57rem; font-weight: 900; }
.settings-section-heading h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.settings-section-heading small { color: var(--muted); font-size: .62rem; }
.settings-section h4 { margin: 13px 0 8px; color: var(--muted); font-size: .61rem; letter-spacing: .09em; text-transform: uppercase; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-card { position: relative; min-width: 0; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-raised); text-align: left; }
.theme-card:hover, .theme-card:focus-visible { border-color: var(--blue); transform: translateY(-1px); }
.theme-card[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue), 0 6px 16px color-mix(in srgb, var(--blue) 14%, transparent); }
.theme-card > span:nth-child(2) { min-width: 0; }
.theme-card strong, .theme-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.theme-card strong { color: var(--ink); font-size: .68rem; }
.theme-card small { margin-top: 2px; color: var(--muted); font-size: .54rem; }
.theme-check { position: absolute; top: 6px; right: 6px; display: none; width: 16px; height: 16px; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: .55rem; font-style: normal; }
.theme-card[aria-pressed="true"] .theme-check { display: grid; }
.theme-preview { position: relative; display: block; width: 46px; height: 34px; overflow: hidden; border-radius: 8px; background: var(--preview-bg); border: 1px solid rgba(128,128,128,.24); }
.theme-preview i, .theme-preview b, .theme-preview em { position: absolute; display: block; border-radius: 3px; }
.theme-preview i { left: 5px; top: 5px; width: 15px; height: 24px; background: var(--preview-card); }
.theme-preview b { left: 24px; right: 5px; top: 5px; height: 8px; background: var(--preview-accent); }
.theme-preview em { left: 24px; right: 5px; bottom: 5px; height: 12px; background: var(--preview-panel); }
.theme-preview-ams { --preview-bg:#edf8fc; --preview-card:#fff; --preview-accent:#079bdd; --preview-panel:#0f202b; }
.theme-preview-light { --preview-bg:#f1f5f9; --preview-card:#fff; --preview-accent:#2563eb; --preview-panel:#172033; }
.theme-preview-dark { --preview-bg:#0f172a; --preview-card:#1d293b; --preview-accent:#38bdf8; --preview-panel:#080f1c; }
.theme-preview-midnight { --preview-bg:#061b30; --preview-card:#0f304c; --preview-accent:#27b4ef; --preview-panel:#03111f; }
.theme-preview-degenerate { --preview-bg:#d9ebe7; --preview-card:#ffffff; --preview-accent:#0fa96f; --preview-panel:#d8f3f7; }
.theme-preview-goat { --preview-bg:#171108; --preview-card:#fff7d9; --preview-accent:#d7a72c; --preview-panel:#4a330d; }
.theme-preview-contrast { --preview-bg:#000; --preview-card:#fff; --preview-accent:#ffe900; --preview-panel:#111; }
.theme-preview-halloween { --preview-bg:#1b0b24; --preview-card:#2a1833; --preview-accent:#ff7a00; --preview-panel:#100817; }
.theme-preview-christmas { --preview-bg:#edf6f1; --preview-card:#fff; --preview-accent:#ba1f3b; --preview-panel:#0d3b2e; }
.theme-preview-thanksgiving { --preview-bg:#f6eadb; --preview-card:#fffdf8; --preview-accent:#c65d21; --preview-panel:#512b1a; }
.theme-preview-newyear { --preview-bg:#07111f; --preview-card:#182334; --preview-accent:#e2be5a; --preview-panel:#030914; }
.theme-preview-valentine { --preview-bg:#faedf2; --preview-card:#fff; --preview-accent:#d73e72; --preview-panel:#671e3c; }
.theme-preview-party { --preview-bg:#160e2a; --preview-card:#38265d; --preview-accent:#22d3ee; --preview-panel:#f472b6; }
.theme-preview-birthday { --preview-bg:#f4ebfa; --preview-card:#fff; --preview-accent:#ec4899; --preview-panel:#8b5cf6; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span:first-child { min-width: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { color: var(--ink); font-size: .72rem; }
.setting-row small { margin-top: 2px; color: var(--muted); font-size: .59rem; line-height: 1.35; }
.setting-row-primary { padding-top: 0; }
.settings-switch { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.settings-switch input { position: absolute; opacity: 0; }
.settings-switch i { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--muted) 44%, var(--canvas)); transition: background .2s ease; }
.settings-switch i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(0,0,0,.2); transition: transform .2s ease; }
.settings-switch input:checked + i { background: var(--blue); }
.settings-switch input:checked + i::after { transform: translateX(18px); }
.settings-switch input:focus-visible + i { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.settings-switch.small { width: 39px; height: 23px; }
.settings-switch.small i::after { width: 17px; height: 17px; }
.settings-switch.small input:checked + i::after { transform: translateX(16px); }
.volume-row { display: block; padding: 9px 0 12px; }
.volume-row > span { display: flex; justify-content: space-between; color: var(--ink); font-size: .68rem; }
.volume-row output { color: var(--blue-strong); font-weight: 850; }
.settings-range { width: 100%; margin: 12px 0 0; accent-color: var(--blue); }
.settings-preview-button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--blue-strong); background: var(--surface-raised); font-size: .61rem; font-weight: 800; }
.settings-preview-button:disabled { opacity: .42; cursor: not-allowed; }
.disabled-settings { opacity: .45; }
.setting-block { padding: 2px 0 12px; }
.setting-block-label { display: block; margin-bottom: 7px; color: var(--ink); font-size: .68rem; font-weight: 800; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); }
.segmented-control button { min-height: 34px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: .65rem; font-weight: 800; }
.segmented-control button[aria-pressed="true"] { color: var(--ink); background: var(--surface-raised); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.reset-appearance-button { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: .7rem; font-weight: 800; }
.reset-appearance-button:hover, .reset-appearance-button:focus-visible { color: var(--ink); border-color: var(--blue); }

.seasonal-decor { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.seasonal-decor[hidden] { display: none; }
.seasonal-decor span { position: absolute; color: var(--blue-strong); opacity: .22; font-size: 1.7rem; text-shadow: 0 4px 12px rgba(0,0,0,.12); animation: seasonal-float 6s ease-in-out infinite alternate; }
.seasonal-decor span:nth-child(1) { left: 2%; top: 17%; }
.seasonal-decor span:nth-child(2) { right: 2%; top: 30%; font-size: 2.1rem; }
.seasonal-decor span:nth-child(3) { left: 3%; bottom: 8%; font-size: 1.4rem; }
.seasonal-decor span:nth-child(4) { right: 3%; bottom: 12%; }
.seasonal-decor span:nth-child(5) { left: 1.2%; top: 48%; font-size: 1.15rem; animation-delay: -2s; }
.seasonal-decor span:nth-child(6) { right: 1.5%; top: 61%; font-size: 1.35rem; animation-delay: -3.4s; }
.seasonal-decor span:nth-child(7) { left: 10%; top: 3%; font-size: 1rem; animation-delay: -1.2s; }
.seasonal-decor span:nth-child(8) { right: 11%; bottom: 3%; font-size: 1.1rem; animation-delay: -4.2s; }
@keyframes seasonal-float { from { transform: translateY(-4px) rotate(-4deg); } to { transform: translateY(6px) rotate(5deg); } }

html:is([data-theme="oe27"], [data-theme="halloween"], [data-theme="christmas"], [data-theme="thanksgiving"], [data-theme="newyear"], [data-theme="valentine"], [data-theme="party"], [data-theme="birthday"]) .controls-panel::before,
html:is([data-theme="oe27"], [data-theme="halloween"], [data-theme="christmas"], [data-theme="thanksgiving"], [data-theme="newyear"], [data-theme="valentine"], [data-theme="party"], [data-theme="birthday"]) .results-panel::before {
  content: ""; position: absolute; z-index: 3; top: 0; left: 28px; right: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--season-accent);
}
html[data-theme="halloween"] .live-pill::after { content: "☾"; }
html[data-theme="christmas"] .live-pill::after { content: "✦"; color: #ba1f3b; }
html[data-theme="thanksgiving"] .live-pill::after { content: "◆"; color: #c65d21; }
html[data-theme="newyear"] .live-pill::after { content: "✧"; color: #e2be5a; }
html[data-theme="valentine"] .live-pill::after { content: "♥"; color: #d73e72; }
html[data-theme="party"] .live-pill::after { content:"✦"; color:#22d3ee; text-shadow:0 0 12px #8b5cf6; }
html[data-theme="birthday"] .live-pill::after { content:"🎈"; color:#db2777; }
html[data-theme="party"] .seasonal-decor span { opacity:.55; text-shadow:0 0 12px currentColor; }
html[data-theme="party"] .seasonal-decor::before { content:""; position:absolute; inset:0; opacity:.34; background:radial-gradient(circle at 12% 20%,#f472b6 0 3px,transparent 4px),radial-gradient(circle at 75% 12%,#22d3ee 0 3px,transparent 4px),radial-gradient(circle at 45% 70%,#facc15 0 3px,transparent 4px); background-size:110px 95px,140px 120px,125px 105px; }
html[data-theme="birthday"] .seasonal-decor span { opacity:.42; }
html[data-theme="degenerate"] .live-pill::after { content: "↗"; color: #0fa96f; text-shadow: 0 0 10px rgba(15,169,111,.28); }
html[data-theme="goat"] .live-pill::after { content:"♛"; color:#d7a72c; text-shadow:0 0 12px rgba(215,167,44,.58); }
html[data-theme="goat"] .seasonal-decor::before { content:""; position:absolute; top:8px; left:2%; right:2%; height:25px; border-top:2px solid rgba(247,211,103,.38); background:radial-gradient(circle at 12px 8px,#f9e27d 0 4px,transparent 5px) 0 0/80px 22px repeat-x; filter:drop-shadow(0 0 8px rgba(215,167,44,.5)); }
html[data-theme="goat"] .seasonal-decor span { color:#f9e27d; opacity:.58; font-weight:950; text-shadow:0 0 14px rgba(215,167,44,.48); }
html[data-theme="goat"] .controls-panel,
html[data-theme="goat"] .results-panel,
html[data-theme="goat"] .tier-reference,
html[data-theme="goat"] .counter-stage { position:relative; border-color:rgba(215,167,44,.58); box-shadow:var(--shadow),inset 0 2px 0 rgba(255,244,187,.45); }
html[data-theme="goat"] .controls-panel::before,
html[data-theme="goat"] .results-panel::before,
html[data-theme="goat"] .counter-stage::before { content:""; position:absolute; z-index:3; left:22px; right:22px; top:0; height:4px; border-radius:0 0 6px 6px; background:linear-gradient(90deg,#8f5a0d,#f9e27d,#d7a72c,#fff5bd,#8f5a0d); background-size:200% 100%; animation:goat-gold-flow 4s linear infinite; }
html[data-theme="goat"] .controls-panel::after,
html[data-theme="goat"] .results-panel::after,
html[data-theme="goat"] .counter-stage::after { content:"♛"; position:absolute; right:22px; bottom:10px; z-index:0; color:rgba(215,167,44,.09); font-size:7rem; font-weight:950; line-height:1; transform:rotate(7deg); pointer-events:none; }
html[data-theme="goat"] .controls-panel > *,
html[data-theme="goat"] .results-panel > *,
html[data-theme="goat"] .counter-stage > * { position:relative; z-index:1; }
html[data-theme="goat"] .range::-webkit-slider-thumb { border-color:#fff4b7; background:#d7a72c; box-shadow:0 0 0 4px rgba(215,167,44,.18),0 0 22px rgba(215,167,44,.38); }
html[data-theme="goat"] .share-card-button,
html[data-theme="goat"] .counter-button-plus { color:#1b1205; background:linear-gradient(135deg,#fff0a2,#d7a72c 58%,#9c6514); box-shadow:0 10px 26px rgba(156,101,20,.25); }
html[data-theme="goat"] .brand { border-color:rgba(215,167,44,.5); background:rgba(255,250,235,.95); box-shadow:0 12px 30px rgba(10,7,1,.24),0 0 0 1px rgba(255,230,139,.25); }
html[data-theme="goat"] .brand img { width:168px; height:84px; object-fit:contain; }
html[data-theme="goat"] .money-piece { filter:drop-shadow(0 0 10px #f9e27d); }
html[data-theme="goat"] .site-header { position:relative; isolation:isolate; }
html[data-theme="goat"] .site-header::after { content:"REIGNING GOAT"; position:absolute; z-index:-1; right:100px; top:50%; color:rgba(249,226,125,.1); font-size:clamp(2.5rem,7vw,6.5rem); font-weight:1000; letter-spacing:-.06em; line-height:.8; transform:translateY(-50%) rotate(-3deg); pointer-events:none; }
html[data-theme="goat"] .eyebrow { color:#f1c95d; text-shadow:0 0 16px rgba(215,167,44,.34); }
html[data-theme="goat"] .header-copy h1 { color:#fff7d6; text-shadow:0 2px 20px rgba(215,167,44,.18); }
html[data-theme="goat"] .header-copy p { color:#d8c89a; }
html[data-theme="goat"] .menu-button { border-color:rgba(249,226,125,.48); background:linear-gradient(145deg,#fff7d3,#d7a72c); box-shadow:0 10px 28px rgba(3,2,0,.3),0 0 18px rgba(215,167,44,.18); }
html[data-theme="goat"] .menu-button span { background:#2a1d08; }
html[data-theme="goat"] .metric-card,
html[data-theme="goat"] .pay-breakdown,
html[data-theme="goat"] .tier-card,
html[data-theme="goat"] .counter-card { border-color:rgba(215,167,44,.38); background:linear-gradient(145deg,#fffdf6,#fff2bd); box-shadow:inset 0 1px rgba(255,255,255,.9),0 12px 30px rgba(56,36,4,.1); }
html[data-theme="goat"] .estimated-total { text-shadow:0 0 24px rgba(249,226,125,.22); }
html[data-theme="goat"] .goat-award-banner { border-color:#f8d767; box-shadow:0 20px 60px rgba(0,0,0,.38),0 0 0 1px rgba(255,235,158,.18),0 0 36px rgba(215,167,44,.16); }
html[data-theme="goat"] .goat-award-seal { animation:goat-seal-float 2.8s ease-in-out infinite; }
@keyframes goat-gold-flow { to { background-position:200% 0; } }
@keyframes goat-seal-float { 50% { transform:translateY(-4px) rotate(-3deg); box-shadow:0 0 0 7px rgba(240,183,49,.1),0 12px 28px rgba(0,0,0,.38),0 0 24px rgba(249,226,125,.22); } }
body.reduced-motion .goat-award-seal,html[data-theme="goat"] body.reduced-motion .controls-panel::before,html[data-theme="goat"] body.reduced-motion .results-panel::before,html[data-theme="goat"] body.reduced-motion .counter-stage::before { animation:none !important; }
html[data-theme="degenerate"] .seasonal-decor::before { content:""; position:absolute; top:11px; left:2%; right:2%; height:20px; border-top:2px solid rgba(34,71,76,.3); border-radius:50%; background:radial-gradient(circle at 10px 7px,#ff4e7b 0 4px,transparent 5px) 0 0/88px 18px repeat-x,radial-gradient(circle at 10px 7px,#f6b82b 0 4px,transparent 5px) 44px 0/88px 18px repeat-x; filter:drop-shadow(0 0 6px rgba(255,78,123,.35)); }
html[data-theme="degenerate"] .seasonal-decor span { opacity:.48; font-weight:950; }
html[data-theme="degenerate"] .seasonal-decor span:nth-child(3n+1) { color:#087e9d; }
html[data-theme="degenerate"] .seasonal-decor span:nth-child(3n+2) { color:#0b8f5e; }
html[data-theme="degenerate"] .seasonal-decor span:nth-child(3n) { color:#d99a09; }
html[data-theme="degenerate"] .controls-panel,
html[data-theme="degenerate"] .results-panel,
html[data-theme="degenerate"] .tier-reference,
html[data-theme="degenerate"] .counter-stage { box-shadow: var(--shadow), inset 0 2px 0 rgba(0,169,214,.16); }
html[data-theme="degenerate"] .controls-panel::before,
html[data-theme="degenerate"] .results-panel::before,
html[data-theme="degenerate"] .counter-stage::before { content:""; position:absolute; z-index:3; top:0; left:24px; right:24px; height:4px; border-radius:0 0 5px 5px; background:linear-gradient(90deg,#00a9d6,#0fa96f,#f6b82b,#ff4e7b,#00a9d6); background-size:180% 100%; animation:degen-party-gradient 4s linear infinite; }
@keyframes degen-party-gradient { to{background-position:180% 0} }
html[data-theme="degenerate"] .controls-panel::after,
html[data-theme="degenerate"] .results-panel::after,
html[data-theme="degenerate"] .counter-stage::after { content:""; position:absolute; inset:0; z-index:0; border-radius:inherit; pointer-events:none; opacity:.2; background-image:radial-gradient(circle,rgba(0,169,214,.28) 1px,transparent 1.3px); background-size:15px 15px; mask-image:linear-gradient(135deg,black,transparent 62%); }
html[data-theme="degenerate"] .controls-panel > *,
html[data-theme="degenerate"] .results-panel > *,
html[data-theme="degenerate"] .counter-stage > * { position:relative; z-index:1; }
html[data-theme="degenerate"] .number-shell input,
html[data-theme="degenerate"] .metric strong,
html[data-theme="degenerate"] .breakdown-card dd,
html[data-theme="degenerate"] .counter-card output,
html[data-theme="degenerate"] .side-quest output { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; font-variant-numeric:tabular-nums; }
html[data-theme="degenerate"] .number-shell,
html[data-theme="degenerate"] .counter-card,
html[data-theme="degenerate"] .control-card { box-shadow:inset 0 0 0 1px rgba(15,169,111,.035); }
html[data-theme="degenerate"] .range::-webkit-slider-thumb { box-shadow:0 0 0 4px rgba(0,169,214,.1),0 0 18px rgba(0,169,214,.2); }
html[data-theme="degenerate"] .results-panel { border:1px solid var(--result-border); }
html[data-theme="degenerate"] .section-kicker.light { color:var(--blue-strong); }
html[data-theme="degenerate"] .copy-button { color:var(--ink); border-color:var(--line); background:rgba(255,255,255,.88); box-shadow:0 6px 16px rgba(23,72,66,.06); }
html[data-theme="degenerate"] .copy-button:hover,html[data-theme="degenerate"] .copy-button:focus-visible { background:var(--blue-soft); }
html[data-theme="degenerate"] .share-card-button { color:#ffffff; background:linear-gradient(135deg,#00a9d6,#0fa96f); box-shadow:0 8px 20px rgba(0,169,214,.16); }
html[data-theme="degenerate"] .share-card-button:hover,html[data-theme="degenerate"] .share-card-button:focus-visible { background:linear-gradient(135deg,#008fb6,#0b8f5e); }
html[data-theme="degenerate"] .metric .status-base { color:#9a6805; }
html[data-theme="degenerate"] .metric .status-good { color:#087d56; }
html[data-theme="degenerate"] .breakdown-total strong { color:#087d56; text-shadow:0 0 16px rgba(15,169,111,.12); }
html[data-theme="degenerate"] .money-piece { filter:drop-shadow(0 0 8px var(--piece-color)); }
.degenerate-scene-fx { position:fixed; z-index:20; inset:0; overflow:hidden; pointer-events:none; }
.degen-coin-drip i { position:absolute; display:none; }
.degen-cpa-meltdown { position:absolute !important; z-index:2 !important; inset:0; display:none; overflow:hidden; border-radius:inherit; pointer-events:none; }
html[data-theme="degenerate"] body[data-degen-cpa="warning"] .degen-cpa-meltdown,
html[data-theme="degenerate"] body[data-degen-cpa="hot"] .degen-cpa-meltdown,
html[data-theme="degenerate"] body[data-degen-cpa="meltdown"] .degen-cpa-meltdown { display:block; }
.degen-smoke { position:absolute; right:5%; bottom:3px; width:140px; height:104px; }
.degen-smoke i { position:absolute; right:0; bottom:-8px; display:none; border:2px solid rgba(68,91,94,.14); border-radius:50%; background:radial-gradient(circle at 34% 30%,#ffffff 0 18%,#d7e3e1 48%,#8ca09f 100%); box-shadow:inset -5px -7px 12px rgba(62,84,86,.13),0 5px 15px rgba(43,67,68,.11); opacity:.84; animation:degen-smoke-rise 1.9s ease-out infinite; }
.degen-smoke i:nth-child(1){width:28px;height:28px;right:4px;animation-delay:-.2s}.degen-smoke i:nth-child(2){width:42px;height:42px;right:24px;animation-delay:-.85s}.degen-smoke i:nth-child(3){width:31px;height:31px;right:57px;animation-delay:-1.35s}.degen-smoke i:nth-child(4){width:53px;height:53px;right:73px;animation-delay:-.45s}.degen-smoke i:nth-child(5){width:34px;height:34px;right:111px;animation-delay:-1.65s}
body[data-degen-cpa="warning"] .degen-smoke i:nth-child(1),body[data-degen-cpa="hot"] .degen-smoke i:nth-child(-n+3),body[data-degen-cpa="meltdown"] .degen-smoke i { display:block; }
.degen-cuss { position:absolute; display:none; padding:8px 13px 9px; border:3px solid #17343c; color:#17343c; background:#ffffff; clip-path:polygon(7% 3%,90% 0,100% 18%,96% 76%,75% 81%,64% 100%,54% 82%,8% 88%,0 65%,3% 18%); box-shadow:4px 5px 0 rgba(15,169,111,.2); font:1000 .78rem/1 Arial,sans-serif; letter-spacing:.05em; }
.degen-cuss-one { right:19%; top:8px; transform:rotate(-4deg); }
.degen-cuss-two { right:3%; bottom:9px; color:#c11f3d; border-color:#c11f3d; transform:rotate(7deg); box-shadow:4px 5px 0 rgba(193,31,61,.16); }
body[data-degen-cpa="hot"] .degen-cuss-one,body[data-degen-cpa="meltdown"] .degen-cuss { display:block; animation:degen-cuss-pop .7s cubic-bezier(.15,.8,.2,1) infinite alternate; }
.degen-sparks i { position:absolute; display:none; width:4px; height:15px; border-radius:999px; background:#f6b82b; box-shadow:0 0 8px rgba(246,184,43,.55); }
.degen-sparks i:nth-child(1){right:9%;top:21%;transform:rotate(42deg)}.degen-sparks i:nth-child(2){right:15%;bottom:14%;transform:rotate(-52deg)}.degen-sparks i:nth-child(3){right:33%;top:19%;transform:rotate(76deg)}.degen-sparks i:nth-child(4){right:41%;bottom:8%;transform:rotate(-18deg)}
body[data-degen-cpa="hot"] .degen-sparks i:nth-child(-n+2),body[data-degen-cpa="meltdown"] .degen-sparks i { display:block; animation:degen-spark .46s ease-in-out infinite alternate; }
@keyframes degen-smoke-rise { 0%{transform:translate(8px,14px) scale(.55);opacity:0} 24%{opacity:.82} 100%{transform:translate(-20px,-84px) scale(1.25);opacity:0} }
@keyframes degen-cuss-pop { from{scale:.88;translate:3px 2px} to{scale:1.04;translate:-2px -2px} }
@keyframes degen-spark { from{scale:.65;opacity:.42} to{scale:1.15;opacity:1} }
.degen-coin-drip i { top:-45px; color:#f7ca4c; font-style:normal; font-size:1.25rem; font-weight:950; text-shadow:0 2px 0 #9c6814,0 0 12px rgba(247,202,76,.55); animation:degen-coin-fall 3.1s linear infinite; }
.degen-coin-drip i:nth-child(1){left:2%;animation-delay:-.2s}.degen-coin-drip i:nth-child(2){left:7%;animation-delay:-1.8s}.degen-coin-drip i:nth-child(3){left:13%;animation-delay:-.9s}.degen-coin-drip i:nth-child(4){left:20%;animation-delay:-2.5s}.degen-coin-drip i:nth-child(5){left:27%;animation-delay:-1.2s}.degen-coin-drip i:nth-child(6){left:35%;animation-delay:-2.9s}.degen-coin-drip i:nth-child(7){right:35%;animation-delay:-.55s}.degen-coin-drip i:nth-child(8){right:27%;animation-delay:-2.2s}.degen-coin-drip i:nth-child(9){right:20%;animation-delay:-1.4s}.degen-coin-drip i:nth-child(10){right:13%;animation-delay:-2.7s}.degen-coin-drip i:nth-child(11){right:7%;animation-delay:-.8s}.degen-coin-drip i:nth-child(12){right:2%;animation-delay:-2s}
body[data-degen-sales="warm"] .degen-coin-drip i:nth-child(-n+3),body[data-degen-sales="hot"] .degen-coin-drip i:nth-child(-n+7),body[data-degen-sales="legend"] .degen-coin-drip i { display:block; }
.degenerate-scene-fx[data-coin-intensity="subtle"] .degen-coin-drip i:nth-child(even) { display:none !important; }
.degenerate-scene-fx[data-coin-intensity="subtle"] .degen-coin-drip i { opacity:.65; animation-duration:4.7s; }
@keyframes degen-coin-fall { 0%{transform:translateY(-5vh) rotate(0deg);opacity:0} 8%{opacity:.9} 92%{opacity:.85} 100%{transform:translateY(112vh) rotate(520deg);opacity:0} }
html[data-theme="oe27"] .money-piece { filter: drop-shadow(0 0 7px var(--piece-color)); }
.page-shell { position: relative; z-index: 1; }

body[data-spacing="compact"] .site-header { padding: 24px 0 18px; }
body[data-spacing="compact"] .controls-panel,
body[data-spacing="compact"] .results-panel { padding: 21px; }
body[data-spacing="compact"] .control-stack { gap: 9px; margin-top: 16px; }
body[data-spacing="compact"] .control-row { gap: 9px; }
body[data-spacing="compact"] .control-card { padding: 12px 14px 10px; }
body[data-spacing="compact"] .planning-dock { padding: 8px; }
body[data-spacing="compact"] .tier-card,
body[data-spacing="compact"] .breakdown-card { margin-top: 10px; padding: 13px; }
body[data-spacing="compact"] .total-block { margin: 16px 0 14px; }

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
body.reduced-motion .cpa-card.under-stress { animation: none !important; }
body.reduced-motion .degenerate-scene-fx { display:none !important; }
body.reduced-motion .degen-cpa-meltdown { display:none !important; }

button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.toast { z-index: 500; color: var(--result-ink); background: var(--result-bg); box-shadow: 0 10px 30px rgba(0,0,0,.25); }

@media (max-width: 900px) {
  .planning-tool-panel { min-height: 0; }
}

@media (max-width: 640px) {
  .degen-cuss { padding:6px 9px 7px; font-size:.62rem; border-width:2px; }
  .degen-cuss-one { right:auto; left:42%; top:7px; }
  .degen-cuss-two { right:3%; bottom:5px; }
  .degen-smoke { right:0; transform:scale(.82); transform-origin:right bottom; }
  html[data-theme="christmas"] .cpa-card .control-heading { gap:8px; }
  .christmas-cpa-status { min-width:0; padding:5px 7px; }
  .christmas-cpa-status small { display:none; }
  .christmas-cpa-status strong { font-size:.52rem; }
  .christmas-cpa-icon { width:20px; height:20px; font-size:.58rem !important; }
  .settings-button { width: 38px; justify-content: center; padding: 0; }
  .settings-button span { display: none; }
  .settings-panel { width: 100%; border-left: 0; }
  .settings-panel-header { padding: 20px 18px 16px; }
  .settings-panel-content { height: calc(100% - 96px); padding: 14px 14px 100px; }
  .settings-section { padding: 14px; }
  .theme-grid { grid-template-columns: 1fr; }
}
