/* Блок «Какой болт или шпилька выдержит» на /metiz (views/ankerovka-widget.pug, public/scripts/ankerovka.js).
   Дизайн — мокап docs/reference/ankerovka-mockup.html (согласован 2026-10-17). Палитра — от «Утеплителей».
   Без Bootstrap: всё под .ank. Bootstrap 3 и style.css подключены глобально — сбрасываем жирные label,
   отступы h2/h3/ul/dl, header {float:left}; общие имена (card, group, btn) — с приставкой ank-. */

@font-face { font-family: 'Unbounded'; src: url('/fonts/all_fonts/unbounded/unbounded-cyrillic.woff2') format('woff2'); font-weight: 500 600; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; src: url('/fonts/all_fonts/unbounded/unbounded-latin.woff2') format('woff2'); font-weight: 500 600; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.ank {
  --snow: #f3f6f9; --paper: #ffffff; --ink: #1c2731; --muted: #5a6876; --line: #dbe2e9;
  --slate: #2f5d8f; --slate-2: #234a74; --slate-soft: #e6eef7;
  --steel: #8796a6; --steel-2: #5f6f80; --steel-soft: #d7dee6;
  --force: #e0602f; --wind: #d99a1e; --wind-soft: #fbefd2;
  --concrete: #e9ecef; --concrete-dot: #b8c0c8; --resin: #f1d79a;
  --ok: #2b7a4b; --ok-bg: #e3f2e8; --warn: #8a5a00; --warn-bg: #fff1cc; --bad: #a02424; --bad-bg: #fde4e4;
  --f-display: 'Unbounded', 'Rubik', system-ui, sans-serif;
  --f-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  display: grid; gap: 18px; margin: 8px 0 32px; clear: both;
  font: 400 15px/1.55 var(--f-body); color: var(--ink);
}
.ank *, .ank *::before, .ank *::after { box-sizing: border-box; }
.ank > * { min-width: 0; }
.ank [hidden] { display: none !important; }
.ank p { margin: 0; }
.ank h2, .ank h3 { margin: 0; padding: 0; text-transform: none; }
.ank label { font-weight: 400; margin: 0; max-width: none; }
.ank button { font-family: var(--f-body); }
.ank a { color: var(--slate); }

/* шапка */
.ank-hero { float: none; width: auto; position: relative; overflow: hidden; background: linear-gradient(118deg, #183c63 0%, var(--slate) 58%, #4f86bd 100%); color: #fff; border-radius: 18px; padding: 26px 28px; display: grid; gap: 8px; }
.ank-hero::after { content: ''; position: absolute; right: -40px; top: -30px; width: 260px; height: 260px; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.14) 0 2px, transparent 3px) 0 0 / 18px 18px; opacity: .7; pointer-events: none; }
.ank-eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; opacity: .8; }
.ank .ank-hero h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; text-wrap: balance; color: #fff; max-width: 22ch; }
.ank-hero p { max-width: 60ch; opacity: .92; font-size: 15px; }

/* карточки задач */
.ank .modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ank .mode { position: relative; cursor: pointer; display: block; }
.ank .mode input { position: absolute; opacity: 0; pointer-events: none; }
.ank .mode-in { height: 100%; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); transition: border-color .15s, box-shadow .15s, background .15s; }
.ank .mode-in svg { width: 52px; height: 52px; }
.ank .mode b { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; }
.ank .mode small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; margin-top: 2px; }
.ank .mode:hover .mode-in { border-color: var(--steel); }
.ank .mode input:checked + .mode-in { border-color: var(--slate); box-shadow: inset 0 0 0 1.5px var(--slate); background: var(--slate-soft); }
.ank .mode input:focus-visible + .mode-in { outline: 2px solid var(--slate); outline-offset: 2px; }
.ank .ico-line { fill: none; stroke: var(--steel-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ank .ico-fill { fill: var(--steel-soft); stroke: var(--steel-2); stroke-width: 2; stroke-linejoin: round; }
.ank .ico-acc { fill: none; stroke: var(--force); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ank .mode input:checked + .mode-in .ico-line, .ank .mode input:checked + .mode-in .ico-fill { stroke: var(--slate); }

/* рабочая область */
.ank .work { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ank-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 14px; min-width: 0; }
.ank .ank-card h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; line-height: 1.3; font-family: var(--f-body); }
.ank .params { gap: 18px; margin: 0; }
.ank-group { display: grid; gap: 12px; }
.ank-group + .ank-group { border-top: 1px solid var(--line); padding-top: 16px; }
.ank .field { display: grid; gap: 6px; min-width: 0; }
.ank .field > span { font-size: 13px; color: var(--muted); }
.ank .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.ank .hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 0; line-height: 1.4; }

/* число с единицей и кнопками ± */
.ank .num { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 34px; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ank .num:focus-within { border-color: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.ank .num button { height: 100%; border: 0; padding: 0; background: var(--snow); color: var(--slate); font-size: 18px; line-height: 1; cursor: pointer; }
.ank .num button:hover { background: var(--slate-soft); }
.ank .num input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; box-shadow: none; background: transparent; font: 500 16px var(--f-body); color: var(--ink); text-align: right; padding: 0 4px 0 8px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ank .num input::-webkit-outer-spin-button, .ank .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ank .num i { font-style: normal; color: var(--muted); font-size: 14px; padding: 0 8px 0 2px; }

/* сегменты вместо выпадающих списков */
.ank .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ank .seg label { position: relative; cursor: pointer; flex: 1 1 0; min-width: 0; display: flex; }
.ank .seg input { position: absolute; opacity: 0; pointer-events: none; }
.ank .opt { width: 100%; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 8px 6px; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: center; font-size: 14px; font-weight: 500; line-height: 1.15; transition: border-color .15s, background .15s, color .15s; }
.ank .opt small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.ank .opt svg { width: 40px; height: 26px; }
.ank .seg label:hover .opt { border-color: var(--steel); }
.ank .seg input:checked + .opt { border-color: var(--slate); background: var(--slate); color: #fff; }
.ank .seg input:checked + .opt small { color: rgba(255,255,255,.82); }
.ank .seg input:checked + .opt .ico-line, .ank .seg input:checked + .opt .ico-fill { stroke: #fff; }
.ank .seg input:checked + .opt .ico-fill { fill: rgba(255,255,255,.2); }
.ank .seg input:checked + .opt .pic-dot { fill: #fff; }
.ank .seg input:checked + .opt .pic-acc { fill: var(--wind); }
.ank .seg input:focus-visible + .opt { outline: 2px solid var(--slate); outline-offset: 2px; }
.ank .seg.tall .opt { padding: 8px 4px 7px; }
.ank .pic-dot { fill: var(--steel-2); }
.ank .pic-acc { fill: var(--force); }
.ank .tag { display: inline-block; font-size: 10.5px; padding: 0 5px; border-radius: 5px; background: var(--wind-soft); color: var(--warn); font-weight: 500; }
.ank .seg input:checked + .opt .tag { background: rgba(255,255,255,.22); color: #fff; }

/* правая колонка */
.ank .out { display: grid; gap: 18px; position: sticky; top: 12px; min-width: 0; }
.ank .scheme { padding: 14px 14px 10px; gap: 8px; }
.ank .scheme-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ank .scheme-head small { color: var(--muted); font-size: 12.5px; }
.ank .scheme svg { display: block; width: 100%; height: auto; }
.ank .sch-pair { display: grid; grid-template-columns: 250fr 400fr; gap: 6px; align-items: end; }
.ank .sch-pair > * { min-width: 0; }
.ank .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.ank .legend span { display: inline-flex; align-items: center; gap: 6px; }
.ank .legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }

/* ответ */
.ank .answer { background: linear-gradient(180deg, var(--paper) 0%, var(--paper) 60%, var(--slate-soft) 100%); border-color: #c6d6e8; }
.ank .rec-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ank .rec-big { font-family: var(--f-display); font-weight: 600; font-size: 34px; line-height: 1; color: var(--slate-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ank .rec-big span { font-family: var(--f-body); font-size: 17px; color: var(--muted); font-weight: 400; }
.ank .rec-big.bad { color: var(--bad); font-size: 22px; }
.ank .util { display: grid; gap: 4px; min-width: 170px; }
.ank .util-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ank .util-bar b { display: block; height: 100%; border-radius: 4px; background: var(--ok); }
.ank .util small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ank .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ank .facts li { padding: 5px 10px; border-radius: 8px; background: var(--snow); border: 1px solid var(--line); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ank .facts li b { font-weight: 600; }
.ank .facts li.alt { background: transparent; border-style: dashed; color: var(--muted); }
.ank .facts li.warn { background: var(--warn-bg); border-color: #f0d28a; color: var(--warn); }
.ank .stud svg { display: block; width: 100%; height: auto; }
.ank .buy { display: grid; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.ank .buy-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 14px; font-size: 14px; align-items: baseline; }
.ank .buy-row + .buy-row { border-top: 1px solid var(--line); }
.ank .buy-row small { color: var(--muted); font-size: 12.5px; display: block; }
.ank .buy-row b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ank .cta { display: flex; flex-wrap: wrap; gap: 8px; }
.ank-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; font-weight: 500; font-size: 14.5px; text-decoration: none !important; border: 1px solid transparent; cursor: pointer; line-height: 1; }
.ank-btn-main { background: var(--slate); color: #fff !important; }
.ank-btn-main:hover { background: var(--slate-2); }
.ank-btn-ghost { background: var(--paper); color: var(--slate) !important; border-color: #c6d6e8; font-variant-numeric: tabular-nums; }
.ank-btn-ghost:hover { background: var(--slate-soft); }

/* таблица и «откуда цифры» */
.ank .below { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ank .tbl-wrap { overflow-x: auto; }
.ank table.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 13.5px; font-variant-numeric: tabular-nums; background: none; margin: 0; }
.ank .heat th { font-weight: 500; color: var(--muted); padding: 4px 6px; text-align: center; white-space: nowrap; border: 0; }
.ank .heat tbody th { text-align: left; color: var(--ink); font-weight: 600; }
.ank .heat td { text-align: center; padding: 5px 4px; border-radius: 7px; white-space: nowrap; border: 0; }
.ank .heat td.ok { background: var(--ok-bg); color: var(--ok); }
.ank .heat td.warn { background: var(--warn-bg); color: var(--warn); }
.ank .heat td.bad { background: var(--bad-bg); color: var(--bad); }
.ank .heat td.mm { color: var(--muted); }
.ank .heat tr.rec td.ok { background: var(--ok); color: #fff; }
.ank .heat tr.rec th { color: var(--slate); }
.ank .heat tr.rec th::after { content: ' ←'; color: var(--slate); }
.ank .scale { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.ank .scale span { display: inline-flex; align-items: center; gap: 5px; }
.ank .scale i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.ank .scale .sc-ok { background: var(--ok-bg); }
.ank .scale .sc-warn { background: var(--warn-bg); }
.ank .scale .sc-bad { background: var(--bad-bg); }
.ank dl.why { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; font-size: 14px; }
.ank .why dt { color: var(--muted); font-weight: 400; }
.ank .why dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.ank .note { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* пояснения под расчётом (видимый текст, без FAQPage) */
.ank-text { line-height: 1.6; font-size: 15px; gap: 10px; }
.ank-text summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.ank .ank-text h3 { font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; margin-top: 6px; }
.ank-text ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* svg-схемы */
.ank .s-txt { font: 500 12px var(--f-body); fill: var(--ink); }
.ank .s-mut { font: 400 11px var(--f-body); fill: var(--muted); }
.ank .s-big { font: 600 13px var(--f-body); }
.ank .s-force { fill: var(--force); }
.ank .s-steel { fill: var(--steel-soft); stroke: var(--steel-2); stroke-width: 1.2; }
.ank .s-steel-d { fill: var(--steel); stroke: var(--steel-2); stroke-width: 1; }
.ank .s-stud { fill: var(--steel-2); }
.ank .s-dim { stroke: var(--muted); stroke-width: 1; fill: none; }
.ank .s-ground { stroke: var(--ink); stroke-width: 1.4; }
.ank .s-arrow-f { stroke: var(--force); stroke-width: 2.6; fill: none; }
.ank .s-arrow-w { stroke: var(--wind); stroke-width: 1.8; fill: none; }
.ank .s-cone { stroke: var(--force); stroke-width: 1.1; stroke-dasharray: 5 4; fill: none; opacity: .75; }
.ank .s-shear { stroke: var(--force); stroke-width: 1.6; stroke-dasharray: 6 4; }
.ank .s-call { stroke: var(--slate); stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; }
.ank .s-panel-bg { fill: var(--snow); }

/* две колонки только на широком экране. В одну колонку: схема → параметры → ответ (2026-10-20, просьба пользователя
   поменять местами «Конструкцию» и «Рекомендуем»; было схема → ответ → параметры). Заодно ответ, который пересчитывается
   на каждый ввод и меняет высоту, больше не стоит над полями — поле не уезжает из-под пальца. */
@media (max-width: 1199px) {
  .ank .work, .ank .below { grid-template-columns: 1fr; }
  .ank .out { display: contents; }
  .ank .scheme { order: -1; }
}
@media (max-width: 620px) {
  .ank .sch-pair { grid-template-columns: 1fr; gap: 12px; }
  .ank .sch-pair .sch-all { max-width: 220px; justify-self: center; width: 100%; }
  .ank .s-txt { font-size: 14px; } .ank .s-mut { font-size: 13px; } .ank .s-big { font-size: 15px; }
  .ank .modes { grid-template-columns: 1fr; }
  .ank .mode-in { grid-template-columns: 40px 1fr; padding: 10px 12px; }
  .ank .mode-in svg { width: 40px; height: 40px; }
  .ank-hero { padding: 20px 18px; }
  .ank .rec-big { font-size: 28px; }
  .ank-card { padding: 16px; }
}
@media (max-width: 400px) { .ank .pair { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ank * { transition: none !important; } }

/* вид сверху: конусы выкола растянутого ряда и выводы по бетону (2026-10-17) */
.ank .sch-top { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.ank .legend .lg-cone { background: rgba(224, 96, 47, .25); height: 10px; }
.ank .legend .lg-over { background: rgba(224, 96, 47, .45); height: 10px; }
.ank .legend .lg-cut { background: repeating-linear-gradient(135deg, var(--muted) 0 1px, transparent 1px 4px); height: 10px; opacity: .7; }
.ank .conc { display: grid; gap: 8px; }
.ank .conc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ank .conc li { position: relative; padding: 8px 12px 8px 30px; border-radius: 10px; background: var(--snow); font-size: 14px; line-height: 1.45; }
.ank .conc li::before { content: ''; position: absolute; left: 12px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--steel); }
.ank .conc li.ok { background: var(--ok-bg); } .ank .conc li.ok::before { background: var(--ok); }
.ank .conc li.warn { background: var(--warn-bg); } .ank .conc li.warn::before { background: var(--wind); }
.ank .conc li.bad { background: var(--bad-bg); color: var(--bad); } .ank .conc li.bad::before { background: var(--bad); }
.ank .sch-top text { paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
