/* ---------- токены ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --ink: #16181d;
  --muted: #5b626e;
  --line: #e4dfd4;
  --accent: #cf4119;
  --accent-ink: #ffffff;
  --accent-soft: #fdeae3;
  --teal: #0b6b64;
  --teal-soft: #dff1ee;
  --gold: #a96b00;
  --gold-soft: #fbf0d9;
  --shadow: 0 1px 2px rgba(22,24,29,.05), 0 8px 24px -12px rgba(22,24,29,.18);
  --shadow-lg: 0 2px 4px rgba(22,24,29,.06), 0 24px 48px -20px rgba(22,24,29,.28);
  --radius: 16px;
  --maxw: 1120px;
  --read: 720px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #171a1f; --surface-2: #1d2128; --ink: #eceef2; --muted: #a0a8b4;
    --line: #272c35; --accent: #ff7a4d; --accent-ink: #1a0d08; --accent-soft: #2b1b15;
    --teal: #4fd1c5; --teal-soft: #12302d; --gold: #f0b44c; --gold-soft: #2c2412;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 24px 48px -20px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #171a1f; --surface-2: #1d2128; --ink: #eceef2; --muted: #a0a8b4;
  --line: #272c35; --accent: #ff7a4d; --accent-ink: #1a0d08; --accent-soft: #2b1b15;
  --teal: #4fd1c5; --teal-soft: #12302d; --gold: #f0b44c; --gold-soft: #2c2412;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 24px 48px -20px rgba(0,0,0,.7);
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 750; margin-top: 2.2em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1.1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- шапка ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: transparent; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.08rem; }
.logo svg { width: 30px; height: 30px; transition: transform .6s var(--ease); }
.logo:hover svg { transform: rotate(-12deg) scale(1.08); }
.logo b { color: var(--accent); font-weight: 800; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  position: relative; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted);
  font-size: .95rem; font-weight: 550; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  transition: transform .25s var(--ease), background .2s, border-color .2s;
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.burger { display: none; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}
@media (max-width: 860px) {
  .burger { display: grid; margin-left: auto; }
  .nav {
    position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 12px 14px;
    clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none; transition: clip-path .35s var(--ease), opacity .25s;
  }
  .nav.open { clip-path: inset(0 0 0 0); opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px; font-size: 1.02rem; }
  .nav a[aria-current="page"]::after { left: 12px; right: auto; width: 24px; bottom: 6px; }
  .theme-btn { margin: 8px 0 0 12px; width: 44px; }
}

/* ---------- главная: hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; isolation: isolate; }
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .5; animation: drift 18s ease-in-out infinite alternate; }
.blob.a { width: 420px; height: 420px; background: var(--accent); left: -120px; top: -140px; opacity: .22; }
.blob.b { width: 380px; height: 380px; background: var(--teal); right: -100px; top: 20px; opacity: .2; animation-duration: 23s; animation-delay: -6s; }
.blob.c { width: 300px; height: 300px; background: #f2b84b; left: 38%; bottom: -160px; opacity: .18; animation-duration: 27s; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(40px,30px,0) scale(1.15); } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .45; } }
.hero h1 { max-width: 16ch; margin-bottom: .45em; font-size: clamp(2.3rem, 6.4vw, 4.4rem); }
.hero h1 em { font-style: normal; color: var(--accent); background: linear-gradient(transparent 70%, color-mix(in srgb, var(--accent) 22%, transparent) 70%); }
.hero p.lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); max-width: 54ch; margin-bottom: 1.6em; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 14px; text-decoration: none; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 44px; }
.stat { background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; backdrop-filter: blur(6px); }
.stat b { display: block; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } .hero { padding-top: 48px; } }

/* ---------- секции и карточки ---------- */
.section { padding: 28px 0 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: clamp(1.4rem, 2.8vw, 1.9rem); }
.section-head a { font-weight: 650; text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card:hover::before { transform: scaleX(1); }
.card h3 { margin: 0; font-size: 1.18rem; line-height: 1.28; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; flex: 1; }
.card .meta { color: var(--muted); font-size: .85rem; display: flex; gap: 10px; align-items: center; }
.card .go { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; font-size: .92rem; }
.card .go svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.card:hover .go svg { transform: translateX(5px); }
.pill {
  display: inline-block; align-self: flex-start; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.pill.teal { background: var(--teal-soft); color: var(--teal); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.card.feature { grid-column: 1 / -1; flex-direction: row; align-items: stretch; gap: 26px; padding: 30px; }
.card.feature .art { flex: 0 0 38%; border-radius: 12px; background: linear-gradient(135deg, var(--accent-soft), var(--teal-soft)); display: grid; place-items: center; min-height: 190px; }
.card.feature .art svg { width: 56%; max-width: 220px; color: var(--accent); }
.card.feature h3 { font-size: 1.6rem; }
.card.feature .body { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center; }
@media (max-width: 720px) { .card.feature { flex-direction: column; padding: 22px; } .card.feature .art { flex-basis: auto; min-height: 150px; } }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); transition: transform .3s var(--ease), box-shadow .3s, border-color .25s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--teal); }
.tile .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin-bottom: 6px; transition: transform .4s var(--ease); }
.tile:hover .ico { transform: rotate(-8deg) scale(1.08); }
.tile .ico svg { width: 22px; height: 22px; }
.tile b { font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: .92rem; }

/* ---------- заголовок страницы ---------- */
.page-head { padding: 52px 0 18px; }
.page-head p { color: var(--muted); max-width: 60ch; font-size: 1.1rem; margin: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* ---------- статья ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, var(--read)) 220px; gap: 56px; justify-content: center; padding: 8px 20px 24px; max-width: calc(var(--read) + 220px + 56px + 40px); margin: 0 auto; }
@media (max-width: 1060px) { .post-layout { grid-template-columns: minmax(0, var(--read)); } .toc-col { display: none; } }
.post-head { max-width: var(--read); margin: 0 auto; padding: 52px 20px 8px; }
@media (min-width: 1061px) { .post-head { max-width: calc(var(--read) + 220px + 56px + 40px); padding-right: 296px; } }
.post-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); margin: 8px 0 14px; }
.post-head .meta { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.post-head .lead { font-size: 1.2rem; color: var(--muted); margin: 18px 0 0; line-height: 1.55; }
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 2em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; padding-left: .2em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose a { font-weight: 550; }
.toc-col { position: relative; }
.toc { position: sticky; top: 92px; font-size: .9rem; border-left: 2px solid var(--line); padding-left: 16px; }
.toc b { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin-bottom: 10px; }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; line-height: 1.35; transition: color .2s, transform .25s var(--ease); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent); font-weight: 650; transform: translateX(4px); }
.callout { border-radius: 14px; padding: 16px 18px; margin: 1.6em 0; border: 1px solid var(--line); background: var(--surface); border-left: 4px solid var(--teal); }
.callout.warn { border-left-color: var(--gold); background: var(--gold-soft); }
.callout.tip { border-left-color: var(--accent); background: var(--accent-soft); }
.callout-title { font-weight: 750; margin-bottom: 4px; font-size: .95rem; }
.callout > div:last-child > :last-child { margin-bottom: 0; }
.tablewrap { overflow-x: auto; margin: 1.4em 0 1.8em; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; position: sticky; top: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 750; background: var(--surface-2); }
.prose table td:first-child { font-weight: 600; }
.sources { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.sources h2 { font-size: 1rem; margin: 0 0 .6em; color: var(--ink); text-transform: uppercase; letter-spacing: .06em; }
.sources li { margin-bottom: .35em; }
.disclaimer { font-size: .88rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin-top: 1.4em; }
.more { max-width: var(--maxw); margin: 28px auto 0; padding: 0 20px; }

/* ---------- график ---------- */
.chart { margin: 1.6em 0; padding: 18px 14px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chart figcaption { text-align: center; color: var(--muted); font-size: .88rem; padding-top: 4px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ylab, .chart .xlab { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.chart .area { opacity: 0; transition: opacity 1s .9s; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; opacity: 0; transform-box: fill-box; transform-origin: center; transition: r .2s, stroke-width .2s; }
.chart.in .line { animation: draw 1.7s var(--ease) forwards; }
.chart.in .area { opacity: 1; }
.chart.in .dot { animation: pop .45s var(--ease) forwards; animation-delay: calc(var(--i) * 110ms + 250ms); }
.chart .dot:hover { r: 7; stroke-width: 3.5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

/* ---------- рецепты и КБЖУ ---------- */
.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 1.4em 0; }
.nutri div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px; text-align: center; }
.nutri b { display: block; font-size: 1.6rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nutri span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.nutri .k { background: var(--accent-soft); border-color: transparent; }
.nutri .k b { color: var(--accent); }
.macrobar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 10px 0 8px; }
.macrobar i { display: block; height: 100%; width: 0; transition: width 1.1s var(--ease); }
.in .macrobar i, .macrobar.in i { width: var(--w); }
.macrobar .p { background: var(--accent); } .macrobar .f { background: var(--gold); } .macrobar .c { background: var(--teal); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--dot); }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.facts span { background: var(--surface-2); border-radius: 999px; padding: 5px 12px; font-size: .88rem; color: var(--muted); }
.card .kbju { display: flex; gap: 12px; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .kbju b { color: var(--ink); }

/* ---------- таблица продуктов ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 14px; }
.search { position: relative; flex: 1 1 260px; }
.search input {
  width: 100%; padding: 12px 14px 12px 42px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#foods th[data-sort] { cursor: pointer; user-select: none; }
#foods th[data-sort]:hover { color: var(--ink); }
#foods th[data-sort]::after { content: " ↕"; opacity: .4; }
#foods th[data-dir="asc"]::after { content: " ↑"; opacity: 1; color: var(--accent); }
#foods th[data-dir="desc"]::after { content: " ↓"; opacity: 1; color: var(--accent); }
#foods tr.hide { display: none; }
#foods td small { display: block; color: var(--muted); font-weight: 400; }
.pbar { display: inline-block; width: 64px; height: 6px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.count { color: var(--muted); font-size: .9rem; margin: 6px 2px 0; }

/* ---------- калькулятор ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 16px; font-size: 1.25rem; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 650; font-size: .92rem; }
.field input, .field select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { font: inherit; font-weight: 650; border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; cursor: pointer; transition: all .25s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.result .big { font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.result .big small { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 6px; }
.result .sub { color: var(--muted); margin: 6px 0 18px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.mini div { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; }
.mini b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.mini span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.note { font-size: .88rem; color: var(--muted); }

/* ---------- подвал ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: .92rem; }
.foot { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.foot a { color: var(--muted); text-decoration: none; display: block; padding: 3px 0; }
.foot a:hover { color: var(--accent); }
.foot b { color: var(--ink); display: block; margin-bottom: 6px; }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease); box-shadow: var(--shadow); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- появление при прокрутке ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- переходы между страницами ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .22s ease both vt-out; }
::view-transition-new(root) { animation: .38s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.site-header { view-transition-name: header; }
::view-transition-group(header) { animation-duration: 0s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .chart .line { stroke-dashoffset: 0; } .chart .dot, .chart .area { opacity: 1; }
  .macrobar i { width: var(--w); }
}
@media print { .site-header, .site-footer, .toc-col, .to-top, .progress { display: none; } body { background: #fff; color: #000; } }
