:root {
  color-scheme: light;
  --bg: #FAF8FF;
  --surface: #FFFFFF;
  --surface-2: #F3EEFF;
  --line: #ECE6F7;
  --line-strong: #CFC4E8;
  --input-border: #B9ABD9;
  --footer: #F3EFFB;
  --shadow: 0 1px 2px rgba(30, 20, 51, 0.06), 0 4px 16px rgba(30, 20, 51, 0.05);
  --text: #1E1433;
  --text-2: #3B3054;
  --muted: #5B5070;
  --dim: #6B6080;
  --accent: #6D28D9;
  --violet: #7C3AED;
  --net: #7C3AED;
  --contrib: #F59E0B;
  --tax: #0EA5E9;
  --accent-ink: #FFFFFF;
  --danger: #B91C1C;
  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #4C1D95; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 22px; padding-bottom: 22px;
}
.logo {
  font-family: var(--display); font-weight: 800; font-size: 22px;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
.logo span { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: 15px;
}
.nav a:hover { border-color: var(--muted); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* Home hero */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 72px; }
.hero-text { flex: 999 1 520px; min-width: 0; }
.hero h1 {
  margin: 0 0 24px; font-family: var(--display); font-weight: 800;
  font-size: clamp(44px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.02em;
}
.hero h1 .second { color: var(--accent); display: block; }
.lead { margin: 0; font-size: 20px; color: var(--muted); max-width: 34em; }

.quick {
  flex: 1 1 340px; min-width: 0; padding: 28px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.quick-result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.quick-result strong { font-family: var(--display); font-size: 30px; color: var(--accent); font-weight: 700; }

/* Calculator list on home */
.list-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.list-head h2, .section-title { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; }
.calc-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text);
}
.calc-row .name { flex: 1 1 300px; font-family: var(--display); font-size: 24px; font-weight: 700; }
.calc-row .desc { flex: 2 1 320px; color: var(--muted); font-size: 16px; }
.calc-row .go { color: var(--accent); font-size: 22px; }
.calc-row:hover .name { color: var(--accent); }
.calc-row.soon { opacity: 0.55; pointer-events: none; }

/* Calculator pages */
.page-head { padding-top: 40px; padding-bottom: 32px; max-width: 820px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.page-head h1 {
  color: var(--text);
  margin: 0 0 16px; font-family: var(--display); font-weight: 800;
  font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.015em;
}

.calc { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-bottom: 48px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px; min-width: 0; box-shadow: var(--shadow);
}
.panel.inputs { flex: 1 1 360px; display: flex; flex-direction: column; gap: 20px; }
.panel.results { flex: 1.3 1 420px; display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .label { font-size: 15px; color: var(--text-2); font-weight: 500; }
.hint { font-size: 14px; color: var(--muted); }
.input {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px;
  border-radius: 12px; background: var(--surface); border: 2px solid var(--input-border);
}
.input:focus-within { border-color: var(--accent); }
.input input, .input select {
  flex: 1; min-width: 0; font: inherit; font-size: 22px; font-weight: 600;
  color: var(--text); background: transparent; border: 0; outline: none; padding: 0;
}
.input select { font-size: 17px; font-weight: 500; appearance: none; cursor: pointer; }
.input select option { background: var(--surface); color: var(--text); }
.input .unit { color: var(--muted); white-space: nowrap; }
.input.invalid { border-color: var(--danger); }
.error { color: var(--danger); font-size: 14px; min-height: 0; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.seg legend { font-size: 15px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; padding: 0; }
.seg label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  color: var(--text-2); font-size: 15px;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--accent-ink); }
.seg label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg label:hover { border-color: var(--input-border); color: var(--text); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; color: var(--text-2); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 1px 0 0; flex: none; }

.big-label { color: var(--muted); font-size: 15px; }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 5vw, 52px); line-height: 1.05; color: var(--accent); }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.bar span { display: block; height: 100%; transition: width 0.25s ease; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

.rows { width: 100%; border-collapse: collapse; font-size: 15px; }
.rows th, .rows td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.rows td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows tr.total th, .rows tr.total td { font-weight: 700; color: var(--text); border-bottom: 0; }
.rows th { color: var(--text-2); }
.rows th small { color: var(--muted); }
.sub { margin: 8px 0 0; font-size: 16px; font-weight: 600; color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat span { display: block; font-size: 14px; color: var(--muted); }
.stat strong { font-size: 20px; font-variant-numeric: tabular-nums; }

details.schedule { border-top: 1px solid var(--line); padding-top: 14px; }
details.schedule summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.table-box { overflow-x: auto; max-height: 420px; overflow-y: auto; margin-top: 8px; }
.table-box table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table-box th, .table-box td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-box th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-weight: 500; }
.table-box th:first-child, .table-box td:first-child { text-align: left; }

.cta-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px; border-radius: 14px; background: var(--surface-2);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none; border: 0; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: #5B21B6; color: var(--accent-ink); }

/* Article content */
.content { max-width: 760px; padding-bottom: 48px; }
.content h2 { font-family: var(--display); font-size: 26px; font-weight: 700; margin: 40px 0 12px; line-height: 1.2; }
.content h3 { font-size: 19px; margin: 24px 0 8px; }
.content p, .content li { color: var(--text-2); }
.content ul { padding-left: 22px; }
.faq details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--text); }
.faq details p { margin-top: 0; }

.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-2); text-decoration: none;
}
.related a:hover { color: var(--text); border-color: var(--muted); }

.ad-slot { margin: 0 0 48px; min-height: 100px; overflow: hidden; }
.ad-slot .adsbygoogle { width: 100%; }

.note { font-size: 14px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); margin-top: 24px; background: var(--footer); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding-top: 32px; padding-bottom: 32px; font-size: 14px; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .panel { padding: 20px; }
  .calc-row .name { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar span { transition: none; }
}

/* Илюстрации */
.hero-art { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
.hero-art img { width: 100%; max-width: 540px; height: auto; }
.hero-text .quick { margin-top: 32px; max-width: 520px; }
.calc-row .thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.calc-row .thumb img { width: 44px; height: 44px; }
.calc-row:hover .thumb { border-color: var(--input-border); }
.page-top { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.page-top .page-head { flex: 999 1 520px; min-width: 0; }
.page-art { flex: 0 1 260px; min-width: 0; display: flex; justify-content: center; padding-bottom: 24px; }
.page-art img { width: 100%; max-width: 260px; height: auto; }
@media (max-width: 720px) { .page-art { display: none; } .hero-art img { max-width: 320px; } }
.cat-title { margin: 40px 0 0; padding-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--accent); letter-spacing: 0.01em; }
.list-head + .cat-title { margin-top: 24px; }
.calc-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
[hidden] { display: none !important; }

/* Контактна форма */
dialog.contact {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 0; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(30, 20, 51, 0.25);
}
dialog.contact::backdrop { background: rgba(30, 20, 51, 0.45); }
.contact-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.contact-head h2 { margin: 0; font-family: var(--display); font-size: 24px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
#contact-form { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 24px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; }
.cf-field label { font-size: 15px; font-weight: 600; color: var(--text-2); }
.cf-input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 2px solid var(--input-border); border-radius: 12px;
}
.cf-input:focus { outline: none; border-color: var(--accent); }
.cf-input[aria-invalid="true"] { border-color: var(--danger); }
textarea.cf-input { resize: vertical; min-height: 140px; }
select.cf-input { cursor: pointer; }
.cf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-status:empty { display: none; }
.cf-status { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.cf-status.ok { background: #ECFDF5; color: #065F46; }
.cf-status.bad { background: #FEF2F2; color: #991B1B; }
.cf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); }
.content .btn { text-decoration: none; }
.ad-slot.ad-inarticle { margin: 32px 0; min-height: 90px; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0 4px; }
.cat-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--accent); font-size: 15px; font-weight: 600; text-decoration: none;
}
.cat-nav a:hover { background: #E9E1FF; }
.cat-title { scroll-margin-top: 16px; }
.panel.inputs details.schedule { display: flex; flex-direction: column; gap: 16px; }
.panel.inputs details.schedule[open] > .field { margin-top: 12px; }
input[type="date"] { font-size: 18px !important; }
