:root {
  color-scheme: light;
  --ink: #181814;
  --quiet: #55534b;
  --paper: #fffdf6;
  --yellow: #ffd637;
  --light-yellow: #fff1ac;
  --line: #25251e;
  font: 1rem/1.5 "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-underline-offset: .22em; }
h1, h2, h3, h4, p { margin: 0; }
button, select, input { font: inherit; }
button { color: inherit; }
[id] { scroll-margin-block-start: 22px; }
:focus-visible { outline: 3px solid #8d3120; outline-offset: 4px; }

.wrap { width: min(100%, 1232px); margin: 0 auto; padding-inline: clamp(16px, 4.3vw, 52px); }
.masthead, .contacts { background: var(--ink); color: white; }
.masthead :focus-visible, .contacts :focus-visible { outline-color: var(--yellow); }
.masthead-inner, .footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.masthead-inner { min-height: 66px; padding-block: 12px; }
.wordmark { display: inline-flex; gap: 12px; align-items: center; font-size: 1.56rem; font-weight: 850; letter-spacing: -.055em; text-decoration: none; }
.brand-mark { position: relative; width: 34px; height: 31px; color: var(--yellow); }
.brand-mark i { position: absolute; top: 5px; width: 21px; height: 21px; border: 2px solid currentColor; transform: rotate(45deg); }
.brand-mark i:first-child { left: 2px; }
.brand-mark i:last-child { left: 10px; }
nav { display: flex; flex-wrap: wrap; gap: 9px 22px; font-size: .9375rem; font-weight: 650; }
nav a { text-decoration: none; }
nav a:hover { color: var(--yellow); text-decoration: underline; }

.cover { border-bottom: 3px solid var(--line); background: var(--yellow); }
.cover-inner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); align-items: end; gap: 16px clamp(24px, 6vw, 80px); padding-block: clamp(29px, 6vw, 76px); }
.cover h1, .section-heading h2, .contacts h2 { font-weight: 850; line-height: .96; letter-spacing: -.071em; }
.cover h1 { max-width: 10ch; font-size: clamp(3rem, 8.1vw, 7.7rem); }
.cover h1 span { color: #78351e; }
.cover-actions p { max-width: 34ch; margin-bottom: 15px; font-size: 1.075rem; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid currentColor; font-weight: 750; line-height: 1.28; text-decoration: none; }
.primary { border-color: var(--ink); background: var(--ink); color: white; }
.primary:hover { background: white; color: var(--ink); }

.calculator, .selector { padding-block: clamp(36px, 6vw, 76px); }
.calculator { border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(200px, .75fr); gap: 12px 28px; align-items: end; margin-bottom: clamp(17px, 4vw, 30px); }
.section-heading h2, .contacts h2 { font-size: clamp(2.25rem, 6vw, 4.7rem); }
.section-heading p { max-width: 50ch; color: var(--quiet); }
.calc-workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(215px, .65fr); grid-template-areas: "results settings"; border: 2px solid var(--line); }
.calc-results { grid-area: results; display: grid; grid-template-rows: 1fr auto; min-width: 0; background: white; }
.calc-settings { grid-area: settings; display: grid; gap: 18px; align-content: center; padding: clamp(18px, 3vw, 31px); border-left: 2px solid var(--line); background: var(--yellow); }
.calc-settings h3 { font-size: 1.34rem; font-weight: 850; }
.range { display: grid; gap: 3px; }
.range-label { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; }
.range label { font-weight: 700; }
.range output { font-size: 1.23rem; font-weight: 850; white-space: nowrap; }
.range input { display: block; width: 100%; height: 29px; margin: 2px 0; accent-color: var(--ink); cursor: pointer; }
.range-ticks { display: flex; justify-content: space-between; font-size: .875rem; }
#tariff-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tariff { min-width: 0; display: grid; gap: 11px; align-content: start; padding: clamp(16px, 3vw, 28px); }
.tariff + .tariff { border-left: 1px solid var(--line); background: #f7f5e9; }
.tariff-top { display: grid; gap: 13px; }
.tariff label { display: block; color: var(--quiet); font-size: .875rem; font-weight: 650; }
.tariff select { width: 100%; min-height: 42px; margin-top: 4px; padding: 5px 8px; border: 1px solid var(--line); background: white; color: var(--ink); }
.tariff-cost { font-size: clamp(1.8rem, 4vw, 3.3rem); font-weight: 850; line-height: 1; letter-spacing: -.047em; white-space: nowrap; }
.tariff-bar { height: 7px; overflow: hidden; background: #eae8db; }
.tariff-bar span { display: block; height: 100%; width: var(--bar-width, 0%); background: var(--ink); transition: width .18s ease; }
.tariff + .tariff .tariff-bar span { background: #a64422; }
.tariff-detail, .tariff-source { font-size: .875rem; }
.tariff-detail { color: var(--quiet); }
.tariff-source { width: fit-content; font-weight: 650; }
.calc-summary { margin: 0; min-height: 3em; padding: 11px clamp(14px, 2.5vw, 28px); border-top: 1px solid var(--line); background: var(--light-yellow); font-weight: 750; }
.calc-note { margin-top: 9px; color: var(--quiet); font-size: .875rem; }

.selector { padding-top: clamp(32px, 5vw, 62px); }
.wizard { display: grid; grid-template-columns: minmax(108px, .24fr) minmax(0, 1fr); gap: 14px 24px; border-block: 2px solid var(--line); padding-block: 14px; }
.wizard-progress { min-width: 0; padding-top: 4px; text-transform: uppercase; letter-spacing: .055em; font-size: .8125rem; font-weight: 800; }
.wizard h3[data-step-title] { margin-bottom: 13px; font-size: clamp(1.4rem, 4vw, 2.15rem); line-height: 1.1; font-weight: 850; letter-spacing: -.04em; }
.choices, .answer-list { display: grid; border-top: 1px solid var(--line); }
.choice { position: relative; display: grid; gap: 4px; align-items: center; min-height: 55px; padding: 10px 32px 10px 10px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.choices .choice { grid-template-columns: minmax(0, 1fr) minmax(120px, .9fr); gap: 4px 14px; }
.choice:hover { background: var(--yellow); }
.choice strong { font-size: 1.0625rem; line-height: 1.2; }
.choice small { color: var(--quiet); font-size: .875rem; }
.choice-mark { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 1.35rem; line-height: 1; font-weight: 600; }
.back-button { display: inline-flex; align-items: center; min-height: 42px; margin-top: 12px; padding: 0 4px; border: 0; background: transparent; font-weight: 750; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; }
.matches-note { margin: 0 0 13px; color: var(--quiet); }
.matches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); }
.matches.single { grid-template-columns: 1fr; }
.match { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 14px; background: white; }
.match + .match { border-left: 1px solid var(--line); }
.match h4 { font-size: 1.18rem; line-height: 1.2; font-weight: 850; }
.product-name { margin: 2px 0 9px; font-weight: 750; }
.match p:not(.product-name), .match dd { color: var(--quiet); font-size: .875rem; }
.match dl { width: 100%; display: grid; gap: 7px; margin: 12px 0; }
.match dl div { border-top: 1px solid #d9d3b9; padding-top: 7px; }
.match dt { font-size: .875rem; font-weight: 750; }
.match dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.match-links { display: grid; gap: 8px; justify-items: start; margin-top: auto; font-size: .875rem; }
.match-links .button { border-color: var(--ink); background: var(--yellow); }
.match-links .button:hover { background: var(--light-yellow); }
.wizard-utility { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0 10px; }
.wizard-utility a { font-size: .9rem; font-weight: 750; }

.contacts { border-top: 4px solid var(--yellow); }
.contact-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .68fr); gap: 22px clamp(23px, 7vw, 88px); align-items: center; padding-block: clamp(28px, 5vw, 60px); }
.contacts p { max-width: 52ch; margin-top: 12px; color: #ece8d8; }
.contact-links { border-top: 1px solid #85806e; }
.contact-link { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid #85806e; text-decoration: none; }
.contact-link span { color: var(--yellow); overflow-wrap: anywhere; }
.contact-link:hover span { text-decoration: underline; }
.footer { min-height: 66px; padding-block: 14px; color: var(--quiet); font-size: .9375rem; }

@media (max-width: 760px) {
  .cover-inner, .section-heading, .contact-inner { grid-template-columns: 1fr; }
  .cover h1 { max-width: 14ch; }
  .cover-actions p { max-width: 49ch; }
  .calc-workspace { grid-template-columns: 1fr; grid-template-areas: "settings" "results"; }
  .calc-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; border-bottom: 2px solid var(--line); }
  .calc-settings h3 { grid-column: 1 / -1; }
  .wizard { grid-template-columns: 1fr; gap: 8px; }
  .wizard-progress { padding-top: 0; }
}

@media (max-width: 440px) {
  .masthead-inner { align-items: flex-start; flex-direction: column; gap: 7px; }
  .cover h1 { font-size: clamp(2.8rem, 12.8vw, 4.4rem); }
  .calc-settings, #tariff-comparison, .matches { grid-template-columns: 1fr; }
  .tariff + .tariff, .match + .match { border-left: 0; border-top: 1px solid var(--line); }
  .calc-settings { gap: 11px; }
  .choices .choice { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tariff-bar span { transition: none; }
}

