/* Ягодный акцент, фисташковый для результата. Системные шрифты — быстрая загрузка. */
:root {
  --bg: #faf8fb; --surface: #ffffff; --fg: #241c27; --muted: #6b6170; --line: #e6dfe9;
  --accent: #a82c57; --accent-soft: #f8e5ec; --ok: #3f7a2e; --ok-soft: #e7f2e0;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161218; --surface: #201a23; --fg: #f2ecf4; --muted: #a99fae; --line: #362d3b;
    --accent: #ee7aa0; --accent-soft: #3b2331; --ok: #94cc7f; --ok-soft: #233220;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--font); }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 920px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 12px; }
.logo { font-weight: 800; font-size: 18px; color: var(--fg); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

main { padding-block: 32px 56px; display: flex; flex-direction: column; gap: 40px; }
.hero { display: flex; flex-direction: column; gap: 10px; }
h1 { font-size: clamp(26px, 4.5vw, 38px); line-height: 1.15; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(20px, 3vw, 26px); line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
h3 { font-size: 18px; margin: 0 0 6px; }
.lead { font-size: 18px; color: var(--muted); margin: 0; max-width: 64ch; }
.prose { max-width: 68ch; }
.prose p, .prose li { margin: 0 0 10px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 12px; }

/* калькулятор */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 20px; }
.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.calc > * { min-width: 0; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; display: grid; gap: 10px; min-width: 0; align-content: start; }
input, select { min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input[type="text"], select, textarea {
  font: inherit; font-size: 16px; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.btn { font: inherit; font-weight: 600; font-size: 15px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.recipe-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }

.tiers { display: grid; gap: 10px; }
.tier { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 10px; align-items: end; }
.tier-n { font-weight: 700; font-size: 14px; padding-bottom: 10px; }
.t-del { font: inherit; font-size: 20px; line-height: 1; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; }

.result-box { background: var(--ok-soft); border-radius: 12px; padding: 16px 18px; display: grid; gap: 6px; }
.result-box p { margin: 0; }
.k { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.k-label { font-size: 14px; color: var(--muted); }
.k-val { font-size: 34px; line-height: 1; color: var(--ok); font-variant-numeric: tabular-nums; }
.warn { color: var(--accent); font-weight: 600; }
.accent { color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.tiers-k { margin: 4px 0 0; padding-left: 20px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.section-row { font-weight: 700; background: var(--bg); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* справочные таблицы */
.ref caption { text-align: left; font-size: 14px; color: var(--muted); padding-bottom: 8px; }
.ref td:first-child, .ref th:first-child { font-weight: 700; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--fg); max-width: 68ch; }

/* призыв */
.cta { border-radius: var(--radius); background: var(--accent-soft); padding: 24px; display: grid; gap: 10px; }
.cta p { margin: 0; max-width: 62ch; }
.cta ul { margin: 0; padding-left: 20px; }

.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.related a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--fg); }
.related a span { display: block; font-size: 14px; color: var(--muted); }
.related a:hover { border-color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); padding-block: 20px 32px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 6px; }
@media (max-width: 480px) {
  .calc { padding: 14px; }
  .tier { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .tier-n { grid-column: 1 / -1; padding: 0; }
}

/* калькулятор себестоимости */
.ing-list { display: grid; gap: 10px; }
.ing { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) 72px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ing label { font-size: 12px; }
.ing input, .ing select { padding: 7px 9px; }
.ing-cost { display: grid; gap: 4px; font-size: 12px; color: var(--muted); padding-bottom: 8px; }
.ing-cost strong { font-size: 15px; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.ref tr.strong td { font-weight: 700; }
@media (max-width: 720px) {
  .ing { position: relative; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ing-name { grid-column: 1 / -1; padding-right: 46px; }
  .ing .t-del { position: absolute; top: 20px; right: 0; width: 36px; height: 36px; }
}

/* юридические документы */
.legal h2 { font-size: 19px; margin-top: 18px; }
.legal p { margin: 0 0 10px; }
.legal .cl { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
