* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --background: #0b0b0d;
  --surface: #101013;
  --raised: #161619;
  --field: #19191d;
  --line: #2a2a30;
  --text: #f5f5f7;
  --muted: #aaaab3;
  --accent: #d9e2ff;
  --action: #f6f6f8;
  --on-action: #17171b;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
body { margin: 0; background: var(--background); color: var(--text); font: 15px/1.55 var(--sans); }
:where(h1, h2, h3, h4, p, figure, dl, dd) { margin: 0; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2.65rem, 5.4vw, 5rem); font-weight: 560; letter-spacing: -.062em; text-wrap: balance; }
h2 { font-size: clamp(1.55rem, 3vw, 2.65rem); font-weight: 590; text-wrap: balance; }
h3 { font-size: 1.125rem; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
input, select { accent-color: var(--accent); }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { opacity: .52; cursor: not-allowed; }
fieldset { border: 0; margin: 0; min-inline-size: 0; padding: 0; }
legend { padding: 0; }
summary { cursor: pointer; }
summary::marker { color: var(--accent); }
code { font-family: var(--mono); overflow-wrap: anywhere; }
section[id], form[id], div[id] { scroll-margin-top: 1rem; }
.sr-only, .visually-hidden, .skip-link:not(:focus), .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus, .skip:focus { position: fixed; z-index: 5; top: .5rem; left: .5rem; padding: .65rem 1rem; background: var(--action); color: var(--on-action); }
.shell, .wrap { width: min(100% - clamp(2rem, 8vw, 9rem), 1240px); margin-inline: auto; }
.topbar, .masthead, .nav-shell { min-height: 66px; display: flex; align-items: center; gap: clamp(1.1rem, 4vw, 3.5rem); }
.topbar nav, .masthead nav, .nav-shell nav { flex: 1; display: flex; align-items: center; gap: clamp(.7rem, 2vw, 1.65rem); }
.topbar nav a, .masthead nav a, .nav-shell nav a { color: var(--muted); font-size: .82rem; text-decoration: none; white-space: nowrap; }
.topbar nav a:hover, .masthead nav a:hover, .nav-shell nav a:hover { color: var(--text); }
.wordmark, .brand { display: inline-flex; align-items: center; gap: .48rem; color: var(--text); text-decoration: none; font-size: 1.12rem; font-weight: 660; letter-spacing: -.04em; white-space: nowrap; }
.wordmark img, .brand img { width: 25px; height: 25px; border-radius: 6px; }
button, .action, .button, .pro-action {
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  border-radius: 8px;
  padding: .5rem .78rem;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.3;
}
button:hover:not(:disabled), .action:hover, .button:hover, .pro-action:hover { border-color: var(--muted); }
button[aria-pressed="true"] { background: var(--field); border-color: var(--accent); color: var(--text); }
.hero-cta, .nav-cta, .pro-action { display: inline-flex; width: fit-content; align-items: center; justify-content: center; gap: .55em; text-decoration: none; }
.hero-cta, .pro-action, :is(.topbar, .masthead, .nav-shell) nav .nav-cta { background: var(--action); color: var(--on-action); border: 1px solid transparent; border-radius: 999px; }
.hero-cta { padding: .65rem 1rem; font-size: .85rem; font-weight: 640; }
:is(.topbar, .masthead, .nav-shell) nav .nav-cta { margin-inline-start: auto; padding: .46rem .72rem; font-size: .77rem; font-weight: 640; }
.hero-cta:hover, .pro-action:hover, :is(.topbar, .masthead, .nav-shell) nav .nav-cta:hover { background: var(--accent); color: var(--on-action); }
.pro-action { padding-inline: .9rem; text-align: center; }
.budgethub-hint { flex-basis: 100%; width: 0; color: var(--muted); font-size: .8rem; }
#save-budgethub:not([href]) + .budgethub-hint { display: none; }
input:not([type="checkbox"], [type="range"]), select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: .52rem .63rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  font-size: .88rem;
}
input[type="range"] { display: block; width: 100%; margin-inline: 0; }
input::placeholder { color: var(--muted); }
label { color: var(--text); font-size: .83rem; font-weight: 570; }
small { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .8rem clamp(.75rem, 2vw, 1.4rem); text-align: right; }
th:first-child { text-align: left; }
thead { background: var(--raised); color: var(--muted); font-size: .77rem; }
tbody tr { border-top: 1px solid var(--line); }
tbody th, tbody td { font-size: .84rem; }
tbody td { font-family: var(--mono); }
.table-wrap, .table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
:is(.table-wrap, .table-scroll):focus-visible { outline-offset: -2px; }
footer { margin-top: clamp(3rem, 7vw, 6rem); padding-block: 2.1rem; border-top: 1px solid var(--line); }
footer h2 { font-size: 1.12rem; }
footer ul { list-style: none; padding: 0; margin: 1rem 0 1.25rem; display: flex; flex-wrap: wrap; gap: .65rem 1.3rem; }
footer a, footer p { color: var(--muted); font-size: .8rem; }
.footer-inner { padding-top: .9rem; border-top: 1px solid var(--line); }

@media (max-width: 620px) {
  .topbar, .masthead, .nav-shell { min-height: 54px; gap: .65rem 1rem; flex-wrap: wrap; padding-block: .62rem; }
  .topbar nav, .masthead nav, .nav-shell nav { gap: .8rem; justify-content: flex-end; }
  :is(.topbar, .masthead, .nav-shell) nav .nav-cta { display: none; }
}
@media (max-width: 360px) {
  .topbar nav, .masthead nav, .nav-shell nav { gap: .6rem; }
}

:root {
  --background: #151322;
  --surface: #1b1729;
  --raised: #211d33;
  --field: #262139;
  --line: #49415c;
  --text: #f0edf8;
  --muted: #bcb3cf;
  --accent: #dfcaff;
  --action: #d0b6ff;
  --on-action: #231238;
}
body { background: radial-gradient(ellipse at 87% 0%, #53396568, transparent 680px), var(--background); }
.site-header { border-bottom: 1px solid #dfcaff23; }
.hero-inner { padding-block: clamp(2.7rem, 5.4vw, 5.3rem) clamp(1.65rem, 3.8vw, 3.4rem); display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .72fr); align-items: end; gap: 1.4rem clamp(1.8rem, 6vw, 6rem); }
.hero-model { color: var(--accent); font: 610 .64rem/1.4 var(--mono); letter-spacing: .08em; }
.hero-model span { display: inline-block; width: 6px; height: 6px; margin-inline-end: .3rem; border-radius: 50%; background: #c7a8f4; }
.hero h1 { margin-top: .6rem; font-size: clamp(2.55rem, 4.7vw, 4.8rem); text-wrap: initial; }
.hero h1 span { display: block; color: #cfbedf; }
.hero-copy > p:not(.hero-model) { color: var(--muted); max-width: 55ch; margin-top: .7rem; }
.hero .hero-cta { margin-top: 1rem; }
.hero-budgethub { margin-top: .65rem; }
.hero-budgethub a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  max-width: 100%;
  min-height: 44px;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  font-size: .85rem;
  font-weight: 600;
}
.hero-figure { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; min-width: 0; min-height: 180px; margin-bottom: .15rem; isolation: isolate; }
.hero-figure img, .hero-figure figcaption { grid-area: 1 / 1; }
.hero-figure img { width: 100%; height: clamp(150px, 17vw, 246px); align-self: end; object-fit: cover; object-position: 50% 48%; border-radius: 12px; opacity: .72; mask-image: linear-gradient(0deg, transparent 0%, #000 47%); }
.hero-figure figcaption { z-index: 1; margin: 0 .6rem; padding: .64rem .75rem; background: #201a30f2; border: 1px solid #5b506d; border-radius: 9px; box-shadow: 0 8px 32px #0007; }
.hero-figure figcaption strong { font-size: .81rem; }
.hero-figure figcaption small { font-size: .68rem; }
.world-rates { display: flex; flex-wrap: wrap; gap: .25rem .64rem; color: var(--accent); font: 620 .78rem/1.5 var(--mono); }

#calculator { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: clamp(.65rem, 2.15vw, 1.6rem); box-shadow: 0 16px 60px #0b071850; }
.section-head, .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; }
.section-head p, .section p { color: var(--muted); margin-top: .34rem; }
.dashboard-head { margin: calc(-1 * clamp(.65rem, 2.15vw, 1.6rem)); margin-bottom: 1rem; padding: clamp(.8rem, 2.15vw, 1.6rem); border-bottom: 1px solid var(--line); }
.dashboard-head h2 { font-size: 1.34rem; }
.dashboard-head p { font-size: .83rem; }
.actions { justify-content: start; gap: .35rem; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: .25rem; gap: .25rem; border: 1px solid var(--line); border-radius: 9px; background: #151222; }
.preset { display: flex; flex-direction: column; align-items: start; justify-content: center; gap: .25rem; padding: .5rem .64rem; min-width: 0; border-color: transparent; background: transparent; text-align: left; }
.preset span { color: var(--muted); font-size: .68rem; font-weight: 450; }
.preset[aria-pressed="true"] { background: #2d2743; border-color: #75638d; }
.forecast { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr); gap: .45rem; margin-block: .85rem; }
.kpi-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.kpi { min-width: 0; padding: .75rem clamp(.65rem, 1.45vw, 1.1rem); border: 1px solid var(--line); border-radius: 9px; background: #241f36; }
.kpi-main { background: linear-gradient(110deg, #38284d, #261e38); }
.kpi h3, .kpi dt { color: var(--muted); font: 580 .79rem/1.25 var(--sans); }
.kpi dd, .monthly-total { display: block; font-size: clamp(1.6rem, 3.25vw, 3rem); line-height: 1.12; font-weight: 600; letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; margin-top: .25rem; }
.kpi-leak dd { color: #facba6; }
.kpi p { color: var(--muted); font-size: .72rem; margin-top: .18rem; }
meter { display: block; grid-column: 1 / -1; width: 100%; height: 6px; margin: .08rem 0 0; appearance: none; border: 0; border-radius: 7px; overflow: hidden; background: #d88d64; }
meter::-webkit-meter-bar { border: 0; border-radius: 7px; background: #ac6e52; }
meter::-webkit-meter-optimum-value { background: #a88bcf; }
meter::-moz-meter-bar { background: #a88bcf; }

.planner { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: .65rem; }
.panel { min-width: 0; padding: clamp(.85rem, 1.9vw, 1.45rem); background: #201b31; border: 1px solid var(--line); border-radius: 9px; }
.panel h3 { font-size: 1.04rem; }
.duration { margin-top: .75rem; padding: .62rem; border: 1px solid var(--line); border-radius: 8px; background: #272139; }
.duration-head, .range-labels { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
.range-labels { color: var(--muted); font-size: .72rem; }
#duration-slider { margin-block: .48rem .26rem; }
.fields label { display: grid; gap: .22rem; min-width: 0; }
.field-box { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); background: var(--field); border-radius: 7px; }
.field-box input { border: 0; background: transparent; }
.field-box span { padding-inline: .48rem; color: var(--muted); font: .72rem var(--mono); }
.duration-number { width: 6rem; }
.fields { margin-top: .65rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.drop-field { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; gap: .32rem .5rem; align-items: center; margin-top: .7rem; }
.drop-field p { grid-column: 1 / -1; }
.drop-field p, .rate-settings p { color: var(--muted); font-size: .75rem; }
.rate-settings { border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .65rem; }
.rate-settings summary { font-size: .84rem; }
.rate-settings summary span { padding-inline: .28rem; color: var(--muted); font-size: .73rem; }
.rate-settings p { margin-top: .48rem; }
.rate-settings button { margin-top: .55rem; }
.results { min-width: 0; }
.breakdown dl { margin-top: .65rem; }
.breakdown dl > div, .official-rates > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .18rem .55rem; padding: .44rem 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
.breakdown dt span { display: block; color: var(--muted); font-size: .7rem; }
.breakdown dd, .official-rates dd { color: var(--accent); font: 600 .81rem/1.6 var(--mono); overflow-wrap: anywhere; }
.breakdown .subtotal { font-weight: 630; }
.breakdown .leak-line :is(dt, dd) { color: #facba6; }
.rate-line { display: flex; flex-wrap: wrap; gap: .35rem; color: var(--muted); margin-top: .6rem; font-size: .78rem; }
.rate-line strong { color: var(--text); }
.notice { display: flex; align-items: start; gap: .75rem; background: #352628; border: 1px solid #725247; border-radius: 8px; padding: .85rem; color: #fbe2d6; margin-top: .8rem; }
.notice-icon { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 6px; background: #503633; color: #ffcdaf; font-family: var(--mono); }
.notice h3 { font-size: 1rem; }
.notice p { font-size: .82rem; margin-top: .33rem; }
.notice a { color: #ffd3b8; }

.section { margin-top: clamp(2.7rem, 6vw, 5rem); }
#comparison .table-wrap { margin-top: 1rem; }
#comparison table { min-width: 33rem; }
tbody .selected { background: #2e2543; }
tbody .selected th { box-shadow: inset 3px 0 #b89cd9; }
.budget-section, .guide { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); gap: 1.25rem clamp(1.4rem, 5vw, 4rem); }
.budget-section { padding: clamp(.85rem, 2.6vw, 1.85rem); background: var(--raised); border: 1px solid var(--line); border-radius: 12px; }
.budget-section h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); }
.budget-control label { display: block; margin-top: .75rem; }
.budget-control .field-box { max-width: 16rem; margin-top: .25rem; }
#budget-help { font-size: .75rem; }
.budget-results { min-width: 0; align-self: center; }
.budget-empty { display: grid; align-items: center; min-height: 120px; padding: 1rem; border: 1px dashed #6e5e81; border-radius: 8px; font-size: .86rem; }
.budget-results th, .budget-results td { padding: .55rem .45rem; overflow-wrap: anywhere; }
.budget-results table { table-layout: fixed; }
.budget-results th:first-child { width: 38%; }
.budget-results td.shortfall { color: #ffb7a8; }
.guide { padding-top: 1.6rem; border-top: 1px solid var(--line); }
.official-rates { margin-top: .6rem; }
.guide .unit-note { font: .7rem var(--mono); margin-bottom: .8rem; }
.sources { padding: 0; list-style: none; }
.sources li { margin-top: .35rem; }
.faq h2 { margin-bottom: .55rem; }
.faq details { border-bottom: 1px solid var(--line); padding-block: .55rem; }
.faq summary { font-weight: 600; }

@media (max-width: 790px) {
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planner, .budget-section, .guide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hero-inner, .forecast { grid-template-columns: minmax(0, 1fr); }
  .nav-shell { column-gap: .7rem; }
  .nav-shell nav { gap: .55rem; }
  .nav-shell nav a { font-size: .75rem; }
  .hero-figure { min-height: 0; }
  .hero-figure img { height: 122px; }
  .kpi dd, .monthly-total { font-size: clamp(1.35rem, 6.5vw, 2.4rem); }
}
