/* «Полка находок»: бумага, чернила и полки.
   Тёплая бумажная основа, ультрамариновые «чернила», горчичные ценники и корешки-категории.
   Шрифты только системные — без внешних запросов. */

:root {
  --paper: #f4efe4;
  --paper-2: #ebe3d2;
  --card: #fffcf5;
  --ink: #1b2130;
  --ink-2: #333a4b;
  --muted: #555b6b;
  --line: #d9cfba;
  --line-strong: #b9ac92;
  --accent: #2f45a8;
  --accent-hover: #22348a;
  --accent-soft: #e2e5f6;
  --on-accent: #ffffff;
  --tag: #f2c14e;
  --tag-ink: #2a2108;
  --wood: #8a6a45;
  --wood-dark: #6e5233;
  --ad-bg: #1b2130;
  --ad-ink: #fffcf5;
  --notice-bg: #1b2130;
  --notice-ink: #e9e3d6;
  --focus: #2f45a8;
  --spine-1: #2f45a8;
  --spine-2: #4a6b58;
  --spine-3: #7a4e7e;
  --spine-4: #f2c14e;
  --spine-5: #3e4a5e;
  --spine-6: #9c5a3c;
  --spine-ink: #ffffff;
  --spine-ink-4: #2a2108;
  --shadow: 0 1px 0 rgba(27, 33, 48, .04), 0 8px 24px -12px rgba(27, 33, 48, .22);
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", "Noto Serif", Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161c;
    --paper-2: #1b1e26;
    --card: #1e2129;
    --ink: #efe9dc;
    --ink-2: #d6d0c3;
    --muted: #a9adb9;
    --line: #2f3340;
    --line-strong: #474c5c;
    --accent: #a3b3ff;
    --accent-hover: #c3ceff;
    --accent-soft: #252c4d;
    --on-accent: #10142a;
    --tag: #f2c14e;
    --tag-ink: #2a2108;
    --wood: #6b5236;
    --wood-dark: #523e28;
    --ad-bg: #efe9dc;
    --ad-ink: #14161c;
    --notice-bg: #0d0f13;
    --notice-ink: #cfc9bc;
    --focus: #f2c14e;
    --spine-1: #4257c4;
    --spine-2: #48685a;
    --spine-3: #7a4e7e;
    --spine-5: #4a5670;
    --spine-6: #9a583a;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius); font-weight: 600;
}
.skip:focus { top: 12px; color: var(--paper); }

.demo-bar {
  background: #f2c14e; color: #1b2130; border-bottom: 3px dashed #1b2130;
  text-align: center; font-weight: 700; font-size: 14px; padding: 6px 16px;
}

.notice { background: var(--notice-bg); color: var(--notice-ink); font-size: 13px; padding: 7px 0; text-align: center; }

/* ---- Шапка ---- */
.site-header {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.2) blur(6px);
}
@supports not (background: color-mix(in srgb, red, blue)) { .site-header { background: var(--paper); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; min-height: 64px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.bm-a { fill: var(--accent); }
.bm-b { fill: var(--tag); }
.bm-c { fill: var(--spine-2); }
.bm-shelf { fill: var(--wood); }
.bm-leg { stroke: var(--wood); stroke-width: 2.4; stroke-linecap: round; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: var(--radius);
  font-weight: 600; font-size: 15px; position: relative;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 4px;
  background: var(--tag); border-radius: 2px;
}

/* ---- Хлебные крошки ---- */
.crumbs { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

/* ---- Герой ---- */
.eyebrow {
  margin: 0 0 10px; font: 600 12px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow-no {
  display: inline-block; background: var(--ink); color: var(--paper); padding: 1px 6px; border-radius: 3px; margin-right: 6px;
}
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 44px 0 28px;
}
.hero h1 { margin: 0 0 14px; font-size: clamp(32px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -.02em; }
.hl {
  background: linear-gradient(transparent 62%, var(--tag) 62%, var(--tag) 92%, transparent 92%);
  padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (prefers-color-scheme: dark) { .hl { background: none; color: var(--tag); } }
.hero-lead { margin: 0; color: var(--ink-2); max-width: 62ch; font-size: 17px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-art { width: 100%; max-width: 420px; justify-self: end; height: auto; }
.art-a { fill: var(--accent); }
.art-b { fill: var(--tag); }
.art-c { fill: var(--spine-2); }
.art-d { fill: var(--spine-6); }
.art-leaf { fill: var(--spine-2); opacity: .85; }
.art-line { fill: var(--paper); opacity: .7; }
.art-shelf { fill: var(--wood); }
.art-bracket { stroke: var(--wood-dark); stroke-width: 6; stroke-linecap: round; }
.art-box { fill: var(--paper-2); stroke: var(--ink); stroke-width: 2.5; }
.art-tape { stroke: var(--ink); stroke-width: 2.5; fill: none; }
.art-phones { stroke: var(--ink); stroke-width: 6; fill: none; stroke-linecap: round; }
.art-face { fill: var(--card); }
.art-stroke { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.art-steam { stroke: var(--line-strong); stroke-width: 3; fill: none; stroke-linecap: round; }
.art-tag path { fill: var(--tag); stroke: var(--ink); stroke-width: 2; }
.art-hole { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }

.stats { display: flex; gap: 10px; margin: 26px 0 0; padding: 0; flex-wrap: wrap; }
.stats div {
  display: flex; flex-direction: column-reverse; padding: 10px 16px 8px; min-width: 104px;
  border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card);
}
.stats dd { margin: 0; font: 700 26px/1.1 var(--font-display); }
.stats dt { font-size: 13px; color: var(--muted); }

.page-head { padding: 22px 0 6px; }
.page-head h1 { margin: 0 0 10px; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; }

/* ---- Секции ---- */
.section { margin: 44px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 20px; border-bottom: 2px solid var(--ink);
}
.section-head h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.section-head .eyebrow { margin-bottom: 6px; }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; padding: 6px 0; }
.more:hover span { display: inline-block; transform: translateX(3px); }

/* ---- Полка-категории ---- */
.bookshelf {
  list-style: none; margin: 0; padding: 8px 14px 18px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 30px 8px;
  background: var(--paper-2); border-radius: var(--radius);
}
.spine { position: relative; }
.spine::after {
  content: ""; position: absolute; left: -9px; right: -9px; bottom: -12px; height: 12px;
  background: var(--wood); border-bottom: 3px solid var(--wood-dark);
}
.spine a {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  width: 64px; height: var(--h, 170px); padding: 12px 6px 10px;
  background: var(--spine-1); color: var(--spine-ink); text-decoration: none;
  border-radius: 4px 4px 2px 2px; position: relative;
  box-shadow: inset 6px 0 0 rgba(255, 255, 255, .12), inset -4px 0 0 rgba(0, 0, 0, .14);
  transition: transform .18s ease;
}
.spine a::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 22px; height: 3px;
  border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; opacity: .55;
}
.spine a:hover, .spine a:focus-visible { transform: translateY(-8px); color: var(--spine-ink); }
.spine-name {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 700 16px/1.1 var(--font-display); max-height: calc(var(--h, 170px) - 64px); overflow: hidden;
  margin-top: 18px;
}
.spine-count { font: 700 12px/1 var(--font-mono); background: rgba(0, 0, 0, .22); padding: 4px 6px; border-radius: 3px; }
.spine-2 a { background: var(--spine-2); }
.spine-3 a { background: var(--spine-3); }
.spine-4 a, .spine-4 a:hover, .spine-4 a:focus-visible { background: var(--spine-4); color: var(--spine-ink-4); }
.spine-4 .spine-count { background: rgba(0, 0, 0, .12); }
.spine-5 a { background: var(--spine-5); }
.spine-6 a { background: var(--spine-6); }

/* ---- Фильтры ---- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 18px 0 8px; scrollbar-width: thin;
}
.chip {
  font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; min-height: 40px; display: inline-flex; align-items: center;
}
.chip:hover { background: var(--paper-2); color: var(--ink); }
.chip span { color: var(--muted); margin-left: 6px; font: 600 12px var(--font-mono); }
.chip[aria-current="page"] { background: var(--ink); color: var(--paper); }
.chip[aria-current="page"] span { color: inherit; opacity: .75; }

.toolbar { display: flex; gap: 10px; margin: 10px 0 18px; flex-wrap: wrap; }
.field { display: flex; }
.search-field { flex: 1 1 260px; }
.search, .sort {
  font: inherit; color: var(--ink); background: var(--card); width: 100%;
  border: 2px solid var(--line-strong); border-radius: var(--radius); padding: 9px 14px; min-height: 46px;
}
.search:focus, .sort:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }

/* ---- Карточки ---- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.coupons { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0;
}
.product { position: relative; transition: transform .18s ease, box-shadow .18s ease; }
.product:hover { transform: translateY(-3px); }
.product-media {
  position: relative; display: block; aspect-ratio: 1; background: var(--paper-2);
  border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.img-ph {
  display: block; width: 100%; height: 100%;
  background:
    radial-gradient(circle at 50% 46%, var(--card) 0 18%, transparent 18.5%),
    repeating-linear-gradient(45deg, transparent 0 12px, color-mix(in srgb, var(--line) 60%, transparent) 12px 13px);
}
.ad-badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: var(--ad-bg); color: var(--ad-ink);
  font: 700 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 8px; border-radius: 3px;
}
.ad-badge.static { position: static; display: inline-block; }
.discount {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font: 700 15px/1 var(--font-mono);
  transform: rotate(-10deg); box-shadow: 0 0 0 3px var(--card);
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { margin: 0; font: 600 11px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.product-title { margin: 0; font: 600 15px/1.35 var(--font); letter-spacing: 0; }
.product-title a {
  color: var(--ink); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-title a:hover { color: var(--accent); text-decoration: underline; }
.note { margin: 0; font-size: 14px; color: var(--muted); }
.price-row { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: auto; }
.price {
  position: relative; display: inline-block; background: var(--tag); color: var(--tag-ink);
  font: 700 18px/1 var(--font-mono); padding: 7px 10px 7px 20px;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
.price::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: var(--card);
}
.old-price { color: var(--muted); font: 14px var(--font-mono); }
.meta { margin: 0; font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px; border-radius: var(--radius); border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; text-align: center;
  box-shadow: 3px 3px 0 var(--accent); transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { color: var(--paper); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--accent); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--accent); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--line-strong); }
.btn.ghost:hover { color: var(--ink); box-shadow: 4px 4px 0 var(--line-strong); }
.btn.is-done { background: var(--spine-2); border-color: var(--spine-2); color: #fff; }

.ad-mark {
  margin: 0; padding-top: 8px; border-top: 1px dashed var(--line-strong);
  font-size: 12px; line-height: 1.4; color: var(--muted); word-break: break-word;
}

/* ---- Купоны-билеты ---- */
.coupon {
  padding: 18px 18px 16px; gap: 10px; position: relative;
  --notch: radial-gradient(circle 11px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
           radial-gradient(circle 11px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  -webkit-mask: var(--notch); mask: var(--notch);
  border: none; border-left: 6px solid var(--tag);
}
.coupon h3 { margin: 0; font: 700 19px/1.25 var(--font-display); }
.coupon-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--accent-soft); color: var(--accent); font: 700 11px/1 var(--font-mono);
  letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 3px;
}
.coupon .desc { margin: 0; font-size: 14px; color: var(--ink-2); }
.coupon details summary { cursor: pointer; list-style: none; }
.coupon details summary::-webkit-details-marker { display: none; }
.coupon details summary span { color: var(--accent); white-space: nowrap; text-decoration: underline; }
.coupon details[open] summary { display: none; }
.coupon details p { margin: 0; }
.coupon-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  padding-top: 14px; border-top: 2px dashed var(--line-strong);
}
.code-box { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.code-box code {
  flex: 1 1 120px; display: flex; align-items: center; justify-content: center; min-height: 46px;
  border: 2px dashed var(--accent); border-radius: var(--radius); padding: 8px 12px; background: var(--paper);
  font: 700 18px/1.2 var(--font-mono); letter-spacing: .08em; color: var(--ink); word-break: break-all;
}
.code-box .btn { flex: 0 0 auto; }

.steps {
  list-style: none; counter-reset: step; margin: 22px 0 6px; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.steps li {
  counter-increment: step; position: relative; padding: 14px 16px 14px 60px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%; background: var(--tag); color: var(--tag-ink);
  font: 700 16px var(--font-mono);
}
.steps-more { margin: 10px 0 0; font-size: 15px; }

/* ---- Гайды ---- */
.guides { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.guide-card {
  position: relative; padding: 20px 20px 22px; background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--guide, var(--accent));
  display: flex; flex-direction: column; gap: 8px; transition: transform .15s ease, box-shadow .15s ease;
}
.guide-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--guide, var(--accent)); }
.guide-2 { --guide: var(--tag); }
.guide-3 { --guide: var(--spine-2); }
.guide-4 { --guide: var(--spine-3); }
.guide-meta { margin: 0; font: 600 12px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide-card h3 { margin: 0; font-size: 21px; line-height: 1.2; }
.guide-card h3 a { color: var(--ink); text-decoration: none; }
.guide-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.guide-card h3 a:hover { text-decoration: underline; }
.guide-card p:last-child { margin: 0; color: var(--ink-2); font-size: 15px; }
.guides-list { margin: 24px 0 48px; }

/* ---- Статья ---- */
.article { padding: 8px 0 12px; }
.article-head { max-width: 820px; padding: 18px 0 22px; border-bottom: 2px solid var(--ink); margin-bottom: 28px; }
.article-head h1 { margin: 0 0 14px; font-size: clamp(30px, 4.6vw, 50px); line-height: 1.08; }
.lead { font-size: 19px; color: var(--ink-2); margin: 0 0 12px; max-width: 68ch; }
.article-dates { margin: 0; font-size: 14px; color: var(--muted); }
.article-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.article-layout > .article-body:only-child { grid-column: 1 / -1; }
.toc {
  position: sticky; top: 92px; font-size: 14px;
  border-left: 4px solid var(--tag); padding: 4px 0 4px 14px;
}
.toc-head { margin: 0 0 8px; font: 700 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.article-body { max-width: 72ch; }
.article-note { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 32px; }
.article-shelves { font-weight: 600; }

.prose { font-size: 17px; line-height: 1.7; }
/* Только прямые потомки: карточки в рекламных блоках статей сохраняют свои стили */
.prose > h2 { font-size: clamp(23px, 2.6vw, 28px); line-height: 1.2; margin: 40px 0 12px; }
.prose > h3 { font-size: 20px; margin: 28px 0 8px; }
.prose > p, .prose > ul, .prose > ol { margin: 0 0 16px; }
.prose > ul > li, .prose > ol > li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose code { font: .9em var(--font-mono); background: var(--paper-2); padding: 1px 5px; border-radius: 3px; }
.page-prose { max-width: 75ch; padding: 18px 0 48px; }
.page-prose h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; margin: 0 0 18px; }
.callout {
  margin: 22px 0; padding: 14px 18px; background: var(--card);
  border: 2px solid var(--ink); border-left-width: 8px; border-radius: var(--radius); font-size: 16px;
}
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--paper-2); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }

/* Рекламный блок в статье: отделён от текста и заметно промаркирован */
.ad-block {
  margin: 30px 0; padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--paper-2); font-size: 16px; line-height: 1.5;
}
.ad-block-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 14px; font-weight: 700; }
.ad-block-head a { margin-left: auto; font-weight: 600; font-size: 15px; }
.ad-block .grid { gap: 12px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty-note {
  margin: 8px 0 24px; padding: 18px 20px; background: var(--card);
  border: 2px dashed var(--ink); border-radius: var(--radius); max-width: 820px;
}
.empty-note p:last-child { margin: 0; font-size: 17px; }

/* ---- Подвал ---- */
.site-footer { margin-top: 64px; background: var(--ink); color: var(--paper); padding: 40px 0 24px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .site-footer { background: #0d0f13; color: var(--ink); } }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--tag); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-legal { grid-column: 1 / -1; display: grid; gap: 4px 28px; grid-template-columns: 1fr 1fr; opacity: .82; font-size: 13px; }
.footer-legal p { margin: 0; }
.brand-footer { color: inherit; margin-bottom: 8px; }
.brand-footer:hover { color: inherit; }
.footer-about p { margin: 6px 0; opacity: .88; max-width: 52ch; }
.footer-updated { font-family: var(--font-mono); font-size: 13px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-head { margin: 0 0 4px; font: 700 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tag); }
.footer-bottom { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(244, 239, 228, .2); text-align: center; font-size: 13px; opacity: .85; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; margin-bottom: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 28px 0 12px; gap: 12px; }
  .hero-art { order: -1; max-width: 150px; justify-self: start; }
  .site-header { position: static; }
  html { scroll-padding-top: 16px; }
  .hero-lead { font-size: 16px; }
  .header-inner { min-height: 0; padding-top: 10px; padding-bottom: 6px; }
  .nav { width: 100%; margin: 0 -12px; width: calc(100% + 24px); }
  .nav a { padding: 8px 12px; }
  .brand { font-size: 20px; }
  .section { margin: 34px 0; }
  .prose { font-size: 16.5px; }
  .lead { font-size: 17px; }
  .footer-legal { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.coupons { grid-template-columns: minmax(0, 1fr); }
  .card-body { padding: 10px; gap: 6px; }
  .product-title { font-size: 14px; }
  .price { font-size: 15px; padding: 6px 8px 6px 18px; }
  .discount { width: 44px; height: 44px; font-size: 13px; }
  .ad-badge { top: 6px; left: 6px; font-size: 10px; padding: 5px 6px; }
  .btn { padding: 10px 12px; font-size: 14px; }
  .product .btn { box-shadow: 2px 2px 0 var(--accent); }
  .stats div { min-width: 0; flex: 1 1 0; padding: 8px 10px 6px; }
  .stats dd { font-size: 22px; }
  .stats dt { font-size: 12px; }
  .spine a { width: 54px; }
  .spine-name { font-size: 14px; }
  .bookshelf { gap: 30px 6px; padding: 8px 10px 18px; }
  .guide-card h3 { font-size: 19px; }
  .footer-grid { grid-template-columns: 1fr; }
  .steps li { padding-left: 56px; }
  .ad-block { padding: 12px; margin: 24px -4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .ad-badge, .price, .tag, .chip[aria-current="page"] { border: 1px solid CanvasText; }
}
