/* Site chrome (header nav, footer) and text pages. Tokens come from /style.css. */

/* header nav: overrides the bare `header` rule in style.css */
header.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.site-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.site-logo img { width: 26px; height: 26px; display: block; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: 6px 10px; border-radius: var(--r); color: var(--ink); text-decoration: none; font-size: 14px; }
.site-nav a:hover { background: var(--soft); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
@media (max-width: 600px) {
  header.site-head { padding: 8px 12px; }
  .site-nav a { padding: 5px 7px; font-size: 13.5px; }
}

/* footer */
footer.site-foot { margin-top: 64px; padding: 28px 24px; border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 13px; }
.site-foot .foot-in { max-width: 1480px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-foot a { color: var(--muted); }
.site-foot p { margin: 0; }

/* Text pages: one system for the hand-written pages (main.page) and the generated ones (main.ex-main).
   One reading column, one type scale, one card, one table, one note. */
main.page, main.ex-main { display: block; max-width: 800px; margin: 0 auto; padding: 40px 24px 16px; font-size: 16.5px; line-height: 1.65; }
@media (max-width: 600px) { main.page, main.ex-main { padding: 24px 16px 8px; font-size: 16px; } }
:is(.page, .ex-main) h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.022em; font-weight: 750; margin: 0 0 14px; text-wrap: balance; }
:is(.page, .ex-main) h2 { font-size: clamp(21px, 2.4vw, 25px); line-height: 1.25; letter-spacing: -.012em; margin: 52px 0 12px; text-wrap: balance; }
:is(.page, .ex-main) h3 { font-size: 18px; line-height: 1.35; margin: 28px 0 8px; }
:is(.page, .ex-main) h2 + h3 { margin-top: 12px; }
:is(.page, .ex-main) p, :is(.page, .ex-main) ul, :is(.page, .ex-main) ol { margin: 0 0 14px; }
:is(.page, .ex-main) ul, :is(.page, .ex-main) ol { padding-left: 22px; }
:is(.page, .ex-main) li { margin: 6px 0; }
:is(.page, .ex-main) li::marker { color: var(--muted); }
:is(.page, .ex-main) a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
:is(.page, .ex-main) b, :is(.page, .ex-main) strong { font-weight: 650; }
.page .lead, .ex-lead { font-size: clamp(17px, 2vw, 19px); line-height: 1.6; color: var(--muted); margin-bottom: 28px; }
.page code { background: var(--soft); border-radius: 4px; padding: 1px 5px; font-size: .9em; }
.page img, .page svg { max-width: 100%; }

/* ---- page layout components (Чертёж) ----
   .wide         a wider main for pages with a table of contents: hero across, then .with-toc
   .hero         first screen: text + .facts + CTA on the left, picture on the right
   .facts        key figures in a hairline grid, digits in Plex Mono
   .with-toc     sticky table of contents beside the reading column; a row of chips on a phone
   details.more  the long part of a section, folded; the h2 and the first paragraph stay open above it
   .est-line     an estimate in one row, the total in the accent */
main.page.wide, main.ex-main.wide { max-width: 1180px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: start; margin: 0 0 12px; }
.hero > * { min-width: 0; }
.hero .lead, .hero .ex-lead { margin-bottom: 0; }
.hero-media .ex-pics { margin-top: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5em, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 20px 0; }
.facts > div { background: var(--panel); padding: 10px 12px; }
.facts b { display: block; font-family: var(--mono); font-weight: 500; font-size: 17px; line-height: 1.3; white-space: nowrap; }
.facts span { display: block; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.with-toc { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }
.with-toc > .flow { max-width: 760px; }
.toc { position: sticky; top: 16px; font-size: 14px; }
.toc p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0 !important; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted) !important; text-decoration: none !important; line-height: 1.35; }
.toc a:hover { color: var(--ink) !important; border-left-color: var(--ink); }
.toc a[aria-current] { color: var(--accent) !important; border-left-color: var(--accent); font-weight: 600; }
:is(.page, .ex-main) .flow > h2:first-child, :is(.page, .ex-main) .flow > section:first-child > h2:first-child { margin-top: 8px; }
:is(.page, .ex-main) h2[id] { scroll-margin-top: 16px; }
:is(.page, .ex-main) details.more { background: none; box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 12px 0 18px; padding: 0; }
:is(.page, .ex-main) details.more > summary { list-style: none; cursor: pointer; padding: 11px 0; font-weight: 600; color: var(--accent); display: flex; justify-content: space-between; gap: 12px; margin: 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '+'; font-family: var(--mono); font-weight: 500; }
details.more[open] > summary::after { content: '−'; }
details.more[open] > summary { margin-bottom: 4px; }
details.more > :last-child { margin-bottom: 14px; }
.est-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(8em, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 14px 0; }
.est-line > div { background: var(--panel); padding: 10px 12px; }
.est-line span { display: block; font-size: 12.5px; color: var(--muted); }
.est-line b { font-family: var(--mono); font-weight: 500; font-size: 17px; white-space: nowrap; }
.est-line > .tot { background: var(--accent); color: #fff; }
.est-line > .tot span { color: rgb(255 255 255 / 80%); }
:is(.page, .ex-main) td.num, :is(.page, .ex-main) th.num { font-family: var(--mono); font-size: .94em; }
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .with-toc { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toc { position: static; margin: 0 0 8px; }
  .toc p { display: none; }
  .toc ul { display: flex; gap: 6px; overflow-x: auto; border: 0; padding-bottom: 4px !important; -webkit-overflow-scrolling: touch; }
  .toc a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; margin: 0; }
  .toc li { flex: none; max-width: calc(100vw - 48px); }
  .toc li a { white-space: normal; overflow-wrap: anywhere; } /* a long chip wraps inside the row instead of being cut */
  .toc a[aria-current] { border-color: var(--accent); background: var(--accent-soft); }
}

/* breadcrumbs */
.ex-crumbs { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.ex-crumbs a { color: inherit; }

/* cards */
.box, .ex-card, .page details, .ex-faq details { background: var(--panel); border: 0; border-radius: var(--r); box-shadow: var(--shadow); }
.box { padding: 22px 24px; margin: 14px 0; }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box h2, .box h3 { font-size: 18px; margin: 0 0 10px; letter-spacing: 0; }
.box ul { padding-left: 20px; }
.box .tag { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 8px; }
.grid-2 > .box { margin: 0; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

/* tables: a white card, quiet header, figures in tabular digits */
:is(.page, .ex-main) table { width: 100%; font-size: 15px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; overflow: hidden; margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
:is(.page, .ex-main) th, :is(.page, .ex-main) td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
:is(.page, .ex-main) tr:last-child > * { border-bottom: 0; }
:is(.page, .ex-main) thead th, :is(.page, .ex-main) tr:first-child > th:not([scope="row"]) { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); background: var(--soft); white-space: normal; }
:is(.page, .ex-main) th[scope="row"] { color: var(--muted); font-weight: 500; background: none; white-space: normal; }
:is(.page, .ex-main) tr.total td, .ex-total td { background: var(--accent-soft); font-weight: 700; color: var(--ink); }
.table-wrap, .ex-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ex-facts th { width: 40%; white-space: normal; }

/* buttons and notes */
.cta, .ex-btn { display: inline-block; background: var(--accent); color: #fff !important; text-decoration: none !important; padding: 12px 22px; border-radius: 10px; font-weight: 600; transition: background .15s; }
.cta:hover, .ex-btn:hover { background: var(--accent-hover); }
.ex-cta { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 20px 0 8px; }
.ex-link { color: var(--accent); }
.ex-note { font-size: 14px; color: var(--muted); }
.note-warn { background: var(--panel); color: var(--ink); border-left: 3px solid #d9a441; border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 14px 0; font-size: 15px; box-shadow: var(--shadow); }
.draft-banner { background: var(--err-bg); color: var(--err); border: 1px solid #e8b9b5; border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; font-weight: 600; }
.ph { background: #fff3b0; padding: 0 3px; border-radius: 3px; }

/* checks on example pages: a quiet list, colour only in the marker */
.ex-main .msg { position: relative; background: none; color: var(--ink); border-radius: 0; margin: 0; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.ex-main .msg::before { content: ''; position: absolute; left: 4px; top: 21px; width: 9px; height: 9px; border-radius: 50%; background: var(--niche); }
.ex-main .msg.warn::before { background: #d9a441; }
.ex-main .msg.err::before { background: var(--err); }
.ex-main .msg.ok { color: var(--ok); border-bottom: 0; }
.ex-main .msg.ok::before { background: var(--ok); }

/* numbered steps */
.steps-list { counter-reset: st; list-style: none; padding: 0 !important; }
.steps-list > li { counter-increment: st; position: relative; padding-left: 44px; margin: 16px 0; }
.steps-list > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* questions */
.page details, .ex-faq details { padding: 14px 18px; margin: 10px 0; }
.page details summary, .ex-faq summary { cursor: pointer; font-weight: 600; }
.page details[open] summary { margin-bottom: 8px; }
.page details > :last-child { margin-bottom: 0; }
.ex-faq { display: grid; gap: 10px; }
.ex-faq details { margin: 0; }
.ex-faq p { margin: 8px 0 0; }

/* pictures and example cards */
.ex-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0 0; }
.ex-pics.one { grid-template-columns: 1fr; }
.ex-pics figure, .ex-card figure { margin: 0; }
.ex-pics img, .ex-card img { display: block; width: 100%; height: auto; border-radius: 12px; background: #e7eae7; }
.ex-pics figcaption, .ex-photo figcaption { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; padding: 0 !important; list-style: none; }
.ex-card { padding: 12px 12px 18px; display: flex; flex-direction: column; gap: 8px; margin: 0 !important; }
.ex-card > :not(figure) { padding: 0 6px; }
.ex-card h2 { font-size: 18px; margin: 6px 0 0; }
.ex-card h2 a { color: inherit; text-decoration: none; }
.ex-card h2 a:hover { color: var(--accent); }
.ex-card p { margin: 0; font-size: 15px; }
.ex-card .ex-price { font-weight: 700; font-size: 17px; }
.ex-card.story { outline: 2px dashed var(--line); box-shadow: none; }
.ex-tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.ex-more { padding-left: 20px; }
.ex-draft { border: 2px solid var(--warn); background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-weight: 700; margin: 8px 0 16px; }
.todo { background: #ffe9a8; color: #5a3d00; padding: 0 3px; border-radius: 3px; font-weight: 600; }
.ex-photo { margin: 16px 0; }
.ex-photo .ph { border: 2px dashed var(--line); border-radius: 12px; min-height: 180px; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); background: var(--panel); }
@media (max-width: 640px) {
  .ex-pics { grid-template-columns: 1fr; }
  .ex-facts th { width: 44%; }
  :is(.page, .ex-main) table { font-size: 14px; }
  :is(.page, .ex-main) th, :is(.page, .ex-main) td { padding: 9px 10px; }
}

/* diagrams on text pages */
figure.fig { margin: 12px 0 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
figure.fig svg { display: block; width: 100%; height: auto; max-width: 560px; margin: 0 auto; font: 13px var(--sans); }
figure.fig figcaption { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.fig .wall { fill: #e4e7eb; stroke: #5f6670; stroke-width: 1.2; }
.fig .niche { fill: #fff; stroke: #5f6670; stroke-width: 1.4; }
.fig .cab { fill: #f1f3f6; stroke: #3a4048; stroke-width: 1.4; }
.fig .cab-ghost { fill: none; stroke: #3a4048; stroke-width: 1.2; stroke-dasharray: 6 4; }
.fig .dim { stroke: var(--niche); stroke-width: 1.6; fill: none; }
.fig .dim-min { stroke: var(--min); stroke-width: 2; fill: none; }
.fig .arc { stroke: var(--min); stroke-width: 1.6; fill: none; stroke-dasharray: 5 4; }
.fig .ceil { stroke: #5f6670; stroke-width: 1.6; stroke-dasharray: 8 5; }
.fig .film { stroke: var(--note); stroke-width: 2; }
.fig .skirt { fill: #e3e7ec; stroke: #7d848e; }
.fig .pipe { fill: #cfd4da; stroke: #7d848e; }
.fig .socket { fill: #fff; stroke: #7d848e; stroke-width: 1.2; }
.fig .trim { fill: #9aa2ad; }
.fig .t { fill: var(--niche); font-family: var(--mono); font-weight: 500; }
.fig .t-min { fill: var(--min); font-family: var(--mono); font-weight: 500; }
.fig .t-muted { fill: var(--muted); }
.fig .head { fill: var(--niche); }
.fig .head-min { fill: var(--min); }

/* text block below the configurator on / */
.site-text { max-width: 900px; margin: 16px auto 0; padding: 8px 20px 0; font-size: 16px; line-height: 1.6; }
.site-text h2 { font-size: 22px; margin: 28px 0 8px; }
.site-text h3 { font-size: 17px; margin: 16px 0 6px; }
.site-text p, .site-text ul, .site-text ol { margin: 0 0 12px; }
.site-text a { color: var(--accent); }
@media (max-width: 600px) { .site-text { padding: 4px 16px 0; font-size: 15.5px; } }

/* 404 */
.big-404 { font-size: 64px; font-weight: 800; color: var(--line); margin: 0; line-height: 1; }

/* text block below the configurator on /: a calm "Чертёж" sheet. Hairline grids instead of shadowed
   cards, step numbers in mono, blue only for links and accents */
.landing { max-width: 1480px; margin: 48px auto 0; padding: 0 24px; font-size: 15px; line-height: 1.55; }
.landing a { color: var(--accent); }
.l-head { max-width: 820px; }
.l-head h2 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.25; margin: 0 0 10px; letter-spacing: -.01em; }
.l-head p { color: var(--muted); margin: 0; font-size: 16px; }
.l-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin: 40px 0 14px; }
/* one hairline grid for products, steps and the four notes */
.l-products, .l-steps, .l-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.l-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.l-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.l-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
.l-card, .l-step { background: var(--panel); padding: 16px 18px; margin: 0; }
.l-products .l-card { font-size: 14px; color: var(--muted); }
.l-products h3 { font-size: 16px; line-height: 1.3; margin: 0 0 6px; }
.l-products h3 a { text-decoration: none; }
.l-products h3 a:hover { text-decoration: underline; }
.l-products p { margin: 0; }
.l-step { display: flex; flex-direction: column; gap: 6px; }
.l-n { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--accent); }
.l-n::before { content: '0'; }
.l-step b { display: block; margin-bottom: 2px; }
.l-card h3 { font-size: 16px; margin: 0 0 8px; }
.l-card * + h3 { margin-top: 16px; }
.l-card ul { margin: 0 0 10px; padding-left: 18px; }
.l-card li { margin: 4px 0; }
.l-card li::marker { color: var(--muted); }
.l-card p { margin: 0 0 10px; }
.l-card > :last-child { margin-bottom: 0; }
/* questions: three hairline columns */
.l-faq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; align-items: start; }
.l-faq details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.l-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.l-faq summary::-webkit-details-marker { display: none; }
.l-faq summary::after { content: '+'; font-family: var(--mono); font-weight: 500; color: var(--accent); }
.l-faq details[open] > summary::after { content: '−'; }
.l-faq details p { margin: 8px 0 0; }
.landing > p { margin: 14px 0 0; }
.landing > .l-note { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
@media (max-width: 1000px) {
  .landing { padding: 0 16px; margin-top: 32px; }
  .l-products, .l-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-faq { grid-template-columns: 1fr; }
  .l-faq details + details { border-top: 0; }
}
@media (max-width: 640px) {
  .l-products, .l-steps, .l-grid { grid-template-columns: 1fr; }
}
.site-logo small { font-weight: 400; font-size: 12.5px; color: var(--muted); }
@media (max-width: 600px) { .site-logo small { display: none; } }

/* "Написать нам" */
.fb-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 16px 0; }
.fb-form p { margin: 0; }
.fb-form label.f { font-size: 14px; }
.fb-form textarea { font: inherit; color: var(--ink); padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); width: 100%; background: var(--panel); resize: vertical; }
.fb-form textarea:hover { border-color: #b9bfc8; }
.fb-form textarea:focus, .fb-form input[type=email]:focus { border-color: var(--accent); background: var(--panel); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.fb-form button.primary { padding: 10px 18px; border-radius: var(--r); }
.fb-form[hidden] { display: none; }
.fb-form .msg.err:empty { padding: 0; margin: 0; background: none; }
.fb-ok:empty { padding: 0; margin: 0; background: none; }
#fb-title:focus { outline: none; }

/* ---- generated pages extras (examples, landings): owned by the generated-pages work ---- */
/* first screen: the text column, then the two pictures stacked on the right — the closed view large,
   the open view small with its caption beside it */
.hero-text .ex-crumbs { margin-bottom: 10px; }
/* four figures in a row; two rows of two where the column is narrow (no hole from auto-fit) */
.hero .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow .est-line { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ex-main .with-toc { margin-top: 44px; }
.hero-text .ex-cta { margin: 0 0 6px; }
.hero-text .ex-note { margin: 0; }
.hero-media .ex-pics { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hero-media .ex-pics figure + figure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.hero-media .ex-pics figure + figure figcaption { margin: 0; }
.hero-media .ex-pics img { border-radius: var(--r); border: 1px solid var(--line); }
/* sections of the reading column: the fold sits tight under the open part */
.flow > section > :last-child { margin-bottom: 0; }
.flow .ex-faq + .ex-cta { margin-top: 18px; }
.flow details.more > .ex-scroll:first-of-type table, .flow details.more > ul:first-of-type, .flow details.more > ol:first-of-type, .flow details.more > p:first-of-type { margin-top: 4px; }
.flow .ex-scroll + details.more { margin-top: -6px; }
/* example cards on /primery/: hairlines instead of shadows, figures in mono */
.ex-main.wide .ex-grid { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.ex-grid .ex-card { box-shadow: none; border: 1px solid var(--line); border-radius: var(--r); padding: 0 0 16px; gap: 6px; }
.ex-grid .ex-card > :not(figure):not(a) { padding: 0 16px; }
.ex-grid .ex-card > a { padding: 0; }
.ex-grid .ex-card img { border-radius: var(--r) var(--r) 0 0; border-bottom: 1px solid var(--line); }
.ex-grid .ex-card h2 { margin: 10px 0 2px; font-size: 18px; line-height: 1.3; text-wrap: pretty; }
.ex-grid .ex-card .ex-dims { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.ex-grid .ex-card .ex-price { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-family: var(--mono); font-weight: 500; font-size: 16px; }
.ex-grid .ex-card.story { outline: 0; border-style: dashed; }
@media (min-width: 961px) and (max-width: 1199px) { .hero .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* one column: the two pictures side by side under the buttons */
@media (max-width: 960px) {
  .hero-media .ex-pics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .hero-media .ex-pics figure + figure { display: block; }
  .hero-media .ex-pics figure + figure figcaption { margin-top: 6px; }
  .ex-main .with-toc { margin-top: 28px; }
}
@media (max-width: 600px) { .hero .facts, .flow .est-line { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ---- hand pages extras (kak-merit, faq, ceny, raspil text, home landing): owned by the hand-pages work ---- */

/* kak-merit: the "what you need" card sits in the hero; diagrams stand beside their section on a wide screen */
.hero-media > .box:first-child { margin-top: 0; }
.km-flow::after { content: ''; display: block; clear: both; }
.km-flow > h2 { clear: both; }
.km-flow > :is(.box, details.more, ul) { display: flow-root; }
@media (min-width: 961px) {
  .km-flow > figure.fig { float: right; width: 44%; margin: 4px 0 14px 28px; }
}

/* wide pages: the lead keeps a reading measure */
main.page.wide > .lead { max-width: 760px; }

/* faq: questions as a hairline list under their group heading */
.faq-list { border-top: 1px solid var(--line); margin: 0 0 8px; }
.page .faq-list details { background: none; box-shadow: none; border-radius: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 12px 0; }
.page .faq-list summary { list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.page .faq-list summary::-webkit-details-marker { display: none; }
.page .faq-list summary::after { content: '+'; font-family: var(--mono); font-weight: 500; color: var(--accent); }
.page .faq-list details[open] > summary::after { content: '−'; }
.page .faq-list summary:hover { color: var(--accent); }

/* raspil text: the fold is a hairline, not the card the questions use */
.rs-main details.more { border-left: 0; border-right: 0; max-width: 74ch; }
.rs-main .with-toc { margin-top: 12px; }
main.ex-main.rs-main.wide { max-width: 1480px; padding-left: 24px; padding-right: 24px; }
.rs-main .ex-faq { display: block; border-top: 1px solid var(--line); max-width: 74ch; }
.rs-main .ex-faq details { background: none; box-shadow: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; padding: 11px 0; max-width: none; }
.rs-main .ex-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.rs-main .ex-faq summary::-webkit-details-marker { display: none; }
.rs-main .ex-faq summary::after { content: '+'; font-family: var(--mono); font-weight: 500; color: var(--accent); }
.rs-main .ex-faq details[open] > summary::after { content: '−'; }
@media (max-width: 600px) { main.ex-main.rs-main.wide { padding-left: 16px; padding-right: 16px; } }

/* "Что нового": dates as a mono rule line, not as big headings */
:is(.page).log h2 { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .02em; color: var(--accent); border-top: 1px solid var(--line); padding-top: 14px; margin: 32px 0 6px; }

/* 404: the code in mono, blue */
.page .big-404 { font-family: var(--mono); font-weight: 500; font-size: 56px; color: var(--accent); letter-spacing: -.02em; margin-bottom: 8px; }

/* four figures in a row: two by two on a narrow screen, so auto-fit leaves no empty cell */
@media (max-width: 760px) {
  main.page :is(.facts, .est-line):has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.flow > .faq-list:last-of-type { margin-bottom: 22px; }
