.ch-calculator {
    --ch-ink: #202522;
    --ch-muted: #6f756f;
    --ch-line: #dfe2dc;
    --ch-paper: #f7f6f1;
    --ch-accent: #8a5c34;
    --ch-accent-dark: #684326;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(38px, 6vw, 88px) 20px;
    color: var(--ch-ink);
}

.ch-calculator *, .ch-calculator *::before, .ch-calculator *::after { box-sizing: border-box; }
.ch-calculator__intro { max-width: 800px; margin-bottom: 34px; }
.ch-calculator__eyebrow { margin: 0 0 10px; color: var(--ch-accent); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.ch-calculator__intro h2 { margin: 0 0 16px; font-size: clamp(36px, 6vw, 66px); line-height: 1.02; letter-spacing: -.035em; }
.ch-calculator__intro > p:last-child { max-width: 720px; margin: 0; color: var(--ch-muted); font-size: 18px; line-height: 1.65; }

.ch-calculator__tabs { display: flex; gap: 8px; margin: 0 0 18px; padding: 6px; border: 1px solid var(--ch-line); border-radius: 16px; background: #fff; }
.ch-calculator__tab { flex: 1; min-height: 50px; border: 0; border-radius: 11px; background: transparent; color: var(--ch-muted); font: inherit; font-weight: 700; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.ch-calculator__tab.is-active { background: var(--ch-ink); color: #fff; }
.ch-calculator__tab:focus-visible, .ch-calculator input:focus-visible, .ch-calculator select:focus-visible, .ch-button:focus-visible { outline: 3px solid rgba(138, 92, 52, .3); outline-offset: 2px; }
.ch-calculator__notice { margin: 0 0 18px; padding: 15px 17px; border: 1px solid rgba(138, 92, 52, .22); border-radius: 12px; background: #fffaf2; color: #5e544a; font-size: 14px; line-height: 1.55; }
.ch-calculator__notice strong { color: var(--ch-ink); }

.ch-calculator__panel { position: relative; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--ch-line); border-radius: 22px; background: var(--ch-paper); }
.ch-calculator__panel[hidden] { display: none; }
.ch-calculator__heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 32px; }
.ch-calculator__heading > span { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: var(--ch-accent); color: #fff; font-size: 13px; font-weight: 800; }
.ch-calculator__heading h2 { margin: 0 0 7px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.025em; }
.ch-calculator__heading p { margin: 0; color: var(--ch-muted); }

.ch-calculator__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.ch-calculator__form--advanced { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.ch-field { display: grid; gap: 8px; color: var(--ch-ink); font-size: 14px; font-weight: 700; }
.ch-field--wide { max-width: 620px; }
.ch-field input, .ch-field select { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #cfd3cc; border-radius: 10px; background: #fff; color: var(--ch-ink); font: inherit; font-weight: 500; }

.ch-calculator__sections { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ch-calculator__sections legend { margin-bottom: 12px; font-size: 17px; font-weight: 800; }
.ch-calculator__sections--custom { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-calculator__sections--custom legend { grid-column: 1 / -1; }
.ch-section-choice { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 72px; padding: 14px 16px; border: 1px solid var(--ch-line); border-radius: 12px; background: #fff; cursor: pointer; }
.ch-section-choice input { width: 20px; height: 20px; accent-color: var(--ch-accent); }
.ch-section-choice span { display: grid; gap: 3px; }
.ch-section-choice strong { font-size: 15px; }
.ch-section-choice small { color: var(--ch-muted); font-weight: 400; line-height: 1.4; }
.ch-section-choice b { white-space: nowrap; font-size: 15px; }
.ch-section-choice.is-required { background: #eeede7; cursor: default; }

.ch-calculator__summary { display: grid; gap: 9px; margin-top: 28px; padding: 24px; border-radius: 16px; background: var(--ch-ink); color: #fff; }
.ch-calculator__summary > span { color: #c7cbc5; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.ch-calculator__summary > strong { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; }
.ch-calculator__summary > small { max-width: 580px; color: #c7cbc5; }
.ch-button { display: inline-flex; justify-content: center; align-items: center; width: fit-content; min-height: 50px; margin-top: 8px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--ch-accent); color: #fff !important; font: inherit; font-weight: 800; text-decoration: none !important; cursor: pointer; transition: background-color .2s ease, transform .2s ease; }
.ch-button:hover { background: var(--ch-accent-dark); transform: translateY(-1px); }
.ch-calculator__form--advanced > .ch-button { min-width: 210px; }
.ch-calculator__status { min-height: 22px; margin: 18px 0 0; color: var(--ch-muted); }
.ch-calculator__status.is-error { color: #a12d27; }
.ch-calculator__summary .ch-calculator__status { margin: 0; color: #f0c4bf; }
.ch-calculator__empty { padding: 24px; border: 1px dashed #b9bdb5; border-radius: 12px; color: var(--ch-muted); background: #fff; }

.ch-calculator__results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.ch-match-card { overflow: hidden; border: 1px solid var(--ch-line); border-radius: 15px; background: #fff; }
.ch-match-card > img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ch-match-card__body { display: grid; gap: 7px; padding: 18px; }
.ch-match-card__meta { min-height: 20px; margin: 0; color: var(--ch-muted); font-size: 13px; }
.ch-match-card h3 { margin: 0 0 8px; font-size: 21px; }
.ch-match-card h3 a { color: var(--ch-ink); text-decoration: none; }
.ch-match-card__body > strong { color: var(--ch-accent-dark); font-size: 24px; }
.ch-match-card__body > small { color: var(--ch-muted); }

@media (max-width: 900px) {
    .ch-calculator__form--advanced, .ch-calculator__results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .ch-calculator { padding-inline: 14px; }
    .ch-calculator__tabs { flex-direction: column; }
    .ch-calculator__panel { padding: 22px 16px; border-radius: 16px; }
    .ch-calculator__heading { gap: 12px; }
    .ch-calculator__heading > span { flex-basis: 38px; width: 38px; height: 38px; }
    .ch-calculator__form--advanced, .ch-calculator__sections--custom, .ch-calculator__results { grid-template-columns: 1fr; }
    .ch-section-choice { grid-template-columns: 22px minmax(0, 1fr); }
    .ch-section-choice b { grid-column: 2; }
    .ch-button, .ch-calculator__form--advanced > .ch-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ch-calculator *, .ch-calculator *::before, .ch-calculator *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
