/* =====================================================================================
 * 3dlib.ru — единая таблица стилей.
 *
 * Структура файла:
 *   1. Токены (цвета, радиусы, тени, тени-анимации)
 *   2. База и типографика
 *   3. Каркас: контейнер, шапка, подвал
 *   4. Общие блоки: кнопки, поля, карточки, чипы, бейджи, таблицы
 *   5. Секции главной страницы
 *   6. Каталог и фильтры
 *   7. Страница модели
 *   8. Калькулятор
 *   9. STL-лаборатория
 *   10. Таблицы материалов и принтеров
 *   11. База знаний
 *   12. Утилиты, анимации, печать
 * ===================================================================================== */

/* ------------------------------------------------------------------ 1. токены */
:root {
    --bg: #0b0f16;
    --bg-2: #0e141e;
    --surface: #141b26;
    --surface-2: #1a2331;
    --surface-3: #212c3c;
    --line: #263141;
    --line-2: #1d2734;

    --ink: #eef3fa;
    --ink-2: #a3b0c2;
    --ink-3: #8b9aae;

    --brand: #ff7a2f;
    --brand-2: #ffa066;
    --brand-soft: rgba(255, 122, 47, .13);
    --brand-line: rgba(255, 122, 47, .35);
    /* Текст и подложки под белым текстом: сам #ff7a2f даёт с белым 2,6:1
       и на светлом фоне как текст еле дотягивает до 3,5:1. */
    --brand-text: #ffa066;
    --brand-solid: #c2410c;
    --accent-solid: #0a6f69;
    --accent: #35c9c0;
    --accent-soft: rgba(53, 201, 192, .13);

    --ok: #3ecf8e;
    --warn: #ffc53d;
    --err: #ff5f6d;
    --info: #5aa9ff;

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --r-xl: 26px;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .35);
    --sh-2: 0 10px 30px rgba(0, 0, 0, .38);
    --sh-3: 0 24px 60px rgba(0, 0, 0, .5);
    --glow: 0 0 0 1px var(--brand-line), 0 12px 40px rgba(255, 122, 47, .18);

    --maxw: 1320px;
    --header-h: 68px;
    --t: .18s cubic-bezier(.4, 0, .2, 1);
}

html[data-theme="light"] {
    --bg: #f2f5f9;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef2f8;
    --line: #dfe6ef;
    --line-2: #eaf0f6;

    --ink: #0e1726;
    --ink-2: #4a5a70;
    --ink-3: #5d6d82;

    /* Статусные цвета на светлом фоне: светлые варианты давали 1,6–2,2:1 */
    --ok: #0f7a4d;
    --warn: #8a5a00;
    --err: #c02634;
    --info: #15599f;
    --accent: #09706b;

    --brand: #e2620f;
    --brand-2: #c9530a;
    --brand-soft: rgba(226, 98, 15, .1);
    --brand-line: rgba(226, 98, 15, .3);
    --brand-text: #ad3f09;
    --brand-solid: #b8430b;
    --accent-solid: #0a7f79;

    --sh-1: 0 1px 2px rgba(14, 23, 38, .06), 0 1px 3px rgba(14, 23, 38, .08);
    --sh-2: 0 8px 24px rgba(14, 23, 38, .08);
    --sh-3: 0 24px 60px rgba(14, 23, 38, .14);
    --glow: 0 0 0 1px var(--brand-line), 0 12px 36px rgba(226, 98, 15, .14);
}

/* ------------------------------------------------------------------ 2. база */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--t), color var(--t);
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after { transition: none !important; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 4.4vw, 52px); }
h2 { font-size: clamp(23px, 2.9vw, 34px); }
h3 { font-size: clamp(17px, 1.6vw, 20px); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-solid); color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.center { text-align: center; }
.nowrap-scroll { overflow-x: auto; }

/* ------------------------------------------------------------------ 3. каркас */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line-2);
}

.site-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 19px; }
.logo__mark { width: 34px; height: 34px; flex: none; }
.logo__domain { color: var(--ink-3); font-weight: 600; font-size: 15px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; flex: 1; min-width: 0; }
.nav__link {
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-weight: 600;
    font-size: 14.5px;
    white-space: nowrap;
    transition: color var(--t), background var(--t);
}
.nav__link:hover { color: var(--ink); background: var(--surface-2); }
.nav__link.is-active { color: var(--brand-text); background: var(--brand-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
    transition: all var(--t);
}
.icon-btn:hover { color: var(--ink); border-color: var(--brand-line); transform: translateY(-1px); }
.icon-btn__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.icon-btn__badge:empty, .icon-btn__badge[data-empty="1"] { display: none; }

.burger { display: none; }

.site-footer {
    margin-top: 80px;
    padding: 48px 0 32px;
    border-top: 1px solid var(--line-2);
    background: var(--bg-2);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-col h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 9px; }
.footer-col a { color: var(--ink-2); font-size: 14.5px; }
.footer-col a:hover { color: var(--brand-text); }
.footer-bottom {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--line-2);
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--ink-3);
}

/* ------------------------------------------------------------------ 4. блоки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--t);
}
.btn:hover { transform: translateY(-1px); border-color: var(--line); }
.btn:active { transform: none; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 20px rgba(255, 122, 47, .25); }
html[data-theme="light"] .btn--primary { box-shadow: 0 6px 18px rgba(226, 98, 15, .22); }
html[data-theme="light"] .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d6d82' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}
.btn--primary:hover { box-shadow: 0 10px 26px rgba(255, 122, 47, .32); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { color: var(--ink); border-color: var(--brand-line); background: var(--brand-soft); }
.btn--sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn--lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.card {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-lg);
    transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.card--pad { padding: 22px; }
.card--hover:hover { border-color: var(--brand-line); transform: translateY(-3px); box-shadow: var(--sh-2); }

.section { padding: 64px 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line-2); }
.section__head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.section__sub { color: var(--ink-2); max-width: 720px; margin-top: 10px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
}
.chip:hover { color: var(--ink); border-color: var(--brand-line); }
.chip.is-on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-text); }
.chip--static { cursor: default; }
.chip--static:hover { color: var(--ink-2); border-color: var(--line); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .02em;
    background: var(--surface-3);
    color: var(--ink-2);
}
.badge--brand { background: var(--brand-soft); color: var(--brand-text); }
.badge--ok { background: rgba(62, 207, 142, .14); color: var(--ok); }
.badge--warn { background: rgba(255, 197, 61, .14); color: var(--warn); }
.badge--err { background: rgba(255, 95, 109, .14); color: var(--err); }
.badge--info { background: rgba(90, 169, 255, .14); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }

.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field__hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.input, .select, textarea.input {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    transition: border-color var(--t), box-shadow var(--t);
}
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[type="range"] { padding: 0; height: 30px; background: transparent; border: none; accent-color: var(--brand); }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b9aae' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 34px;
    cursor: pointer;
}
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.range-value { min-width: 78px; text-align: right; font-weight: 700; font-size: 14px; color: var(--brand-text); }

.search-box { position: relative; flex: 1; min-width: 0; }
.search-box .input { padding-left: 40px; padding-right: 74px; }
.search-box__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box__kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-3);
    font-size: 11.5px;
    color: var(--ink-3);
    pointer-events: none;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data thead th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-3);
    cursor: pointer;
    user-select: none;
    z-index: 2;
}
table.data thead th.no-sort { cursor: default; }
table.data tbody tr { transition: background var(--t); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-variant-numeric: tabular-nums; }

.stars { display: inline-flex; align-items: center; gap: 3px; color: var(--warn); font-size: 13px; font-weight: 700; }
.stars__empty { color: var(--ink-3); font-weight: 500; }

.meter { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.meter__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.meter__fill--ok { background: linear-gradient(90deg, #2fa87a, var(--ok)); }
.meter__fill--warn { background: linear-gradient(90deg, #d99b12, var(--warn)); }
.meter__fill--err { background: linear-gradient(90deg, #d33, var(--err)); }

.notice {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--info);
    border-radius: var(--r);
    background: var(--surface-2);
    font-size: 14px;
    color: var(--ink-2);
}
.notice--warn { border-left-color: var(--warn); }
.notice--err { border-left-color: var(--err); }
.notice--ok { border-left-color: var(--ok); }
.notice b { color: var(--ink); }
.notice__icon { flex: none; font-size: 17px; line-height: 1.4; }

/* ------------------------------------------------------------------ карточка модели */
.model-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.model-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.model-card__media svg { width: 100%; height: 100%; transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.model-card:hover .model-card__media svg { transform: scale(1.06); }
.model-card__tags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.model-card__fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 9px;
    background: rgba(10, 14, 20, .62);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: all var(--t);
}
.model-card:hover .model-card__fav, .model-card__fav.is-on { opacity: 1; }
.model-card__fav.is-on { color: var(--brand-text); background: rgba(255, 122, 47, .18); }
.model-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.model-card__title { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.model-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); margin-top: auto; padding-top: 8px; }
.model-card__meta b { color: var(--ink-2); font-weight: 700; }

.grid-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }

/* ------------------------------------------------------------------ 5. главная */
.hero {
    position: relative;
    overflow: hidden;
    padding: 74px 0 66px;
    background:
        radial-gradient(760px 420px at 84% -10%, rgba(255, 122, 47, .22), transparent 62%),
        radial-gradient(620px 400px at 6% 108%, rgba(53, 201, 192, .16), transparent 60%),
        var(--bg-2);
    border-bottom: 1px solid var(--line-2);
}
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { margin: 20px 0 18px; }
.hero h1 em { font-style: normal; color: var(--brand-text); }
.hero__lead { font-size: 18px; color: var(--ink-2); max-width: 560px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line-2); }
.hero__stats div { font-size: 13px; color: var(--ink-3); }
.hero__stats b { display: block; font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }

.hero__visual { position: relative; }
.hero__canvas-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 122, 47, .14), transparent 58%),
        var(--surface);
    box-shadow: var(--sh-3);
    overflow: hidden;
}
.hero__canvas { width: 100%; height: 100%; cursor: grab; }
.hero__canvas:active { cursor: grabbing; }
.hero__hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(10, 14, 20, .6);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, .82);
    font-size: 12.5px;
    pointer-events: none;
}

.feature-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.feature-card__icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand-text);
}
.feature-card h3 { font-size: 17px; }

/* Часть заголовков секций стоит сразу после h1 страницы, поэтому это h2 —
   так иерархия не перескакивает уровень. Чтобы дизайн не изменился, для них
   сохраняем прежний размер и отступы h3. */
.feature-card h2,
.article-card h2,
.empty-state h2,
.calc-layout h2,
.model-layout h2,
.grid-3 > .card--pad > h2 { font-size: clamp(17px, 1.6vw, 20px); }
.feature-card h2 { font-size: 17px; }
.empty-state h2 { margin-bottom: 8px; }
.prose h2 { color: var(--ink); margin: 28px 0 12px; font-size: clamp(17px, 1.6vw, 20px); }
.feature-card p { color: var(--ink-2); font-size: 14.5px; }
.feature-card__link { margin-top: auto; padding-top: 6px; color: var(--brand-text); font-weight: 700; font-size: 14px; }

/* Превью принтера: фотография с Commons либо схема. */
.printer-media {
    position: relative;
    margin: -6px -6px 8px;
    border-radius: 12px;
    overflow: hidden;
}
.printer-media--photo { aspect-ratio: 4 / 3; background: #10161f; }
.printer-media--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
}
.printer-media__credit {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 10px 7px;
    background: linear-gradient(to top, rgba(6, 9, 14, .82), rgba(6, 9, 14, 0));
    color: #e8eef6;
    font-size: 11.5px;
    line-height: 1.35;
}
.credits-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.credits-list li { font-size: 13.5px; color: var(--ink-2); }
.credits-list a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
.credits-list a:hover { color: var(--brand); }

.step { display: grid; gap: 12px; padding: 20px; }
.step__num {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--brand-solid);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}
.step p { color: var(--ink-2); font-size: 14.5px; }

.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    overflow: hidden;
}
.cat-card__bg { position: absolute; inset: 0; opacity: .5; transition: transform .4s; }
.cat-card:hover .cat-card__bg { transform: scale(1.08); }
.cat-card > * { position: relative; }
.cat-card__icon { width: 40px; height: 40px; color: var(--brand-text); }
.cat-card__n { font-size: 12.5px; color: var(--ink-3); }

.cta-band {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 26px;
    align-items: center;
    padding: 38px 34px;
    border-radius: var(--r-xl);
    border: 1px solid var(--brand-line);
    background: linear-gradient(120deg, rgba(255, 122, 47, .14), rgba(53, 201, 192, .1)), var(--surface);
}

/* ------------------------------------------------------------------ 6. каталог */
.catalog { display: grid; grid-template-columns: 268px 1fr; gap: 28px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 18px); padding: 20px; }
.filters__group { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.filters__group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filters__title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 11px; font-weight: 800; }
.filters__list { display: grid; gap: 7px; }
.check {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-2);
    transition: background var(--t), color var(--t);
}
.check:hover { background: var(--surface-2); color: var(--ink); }
.check input { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; flex: none; }
.check__n { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.catalog__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.catalog__count { font-size: 14px; color: var(--ink-2); }
.catalog__count b { color: var(--ink); }
.catalog__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.empty-state { padding: 60px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--surface); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--ink-2); margin-bottom: 18px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 32px; }
.pager__btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink-2);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--t);
}
.pager__btn:hover:not([disabled]) { border-color: var(--brand-line); color: var(--ink); }
.pager__btn.is-active { background: var(--brand-solid); border-color: var(--brand-solid); color: #fff; }
.pager__btn[disabled] { opacity: .4; pointer-events: none; }

/* ------------------------------------------------------------------ 7. страница модели */
.model-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 32px; align-items: start; }
.gallery { display: grid; gap: 12px; }
.gallery__main {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line-2);
    background: var(--surface-2);
}
.gallery__img { position: absolute; inset: 0; }
.gallery__main svg { width: 100%; height: 100%; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.gallery__thumb {
    aspect-ratio: 1;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-2);
    cursor: pointer;
    padding: 0;
    transition: border-color var(--t), transform var(--t);
}
.gallery__thumb:hover { border-color: var(--brand-line); transform: translateY(-2px); }
.gallery__thumb.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: rgba(10, 14, 20, .58);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--t);
}
.gallery__main:hover .gallery__nav { opacity: 1; }
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }

.side-panel { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 16px; }
.spec-list { display: grid; gap: 0; }
.spec-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line-2);
    font-size: 14px;
}
.spec-row:last-child { border-bottom: none; }
.spec-row__k { color: var(--ink-3); min-width: 0; }
.spec-row__v { font-weight: 700; text-align: right; min-width: 0; }

.settings-block { display: grid; gap: 12px; }
.settings-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.settings-row:last-child { border-bottom: none; }
.settings-row span:first-child { color: var(--ink-3); }
.settings-row b { font-weight: 700; }

.author-card { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    font-size: 15px;
    background: linear-gradient(135deg, var(--brand-solid), var(--accent-solid));
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 24px; overflow-x: auto; }
.tab {
    padding: 11px 16px;
    border: none;
    background: none;
    color: var(--ink-3);
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color var(--t), border-color var(--t);
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--brand-text); border-bottom-color: var(--brand); }

.rating-input { display: flex; gap: 4px; }
.rating-input button {
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: var(--ink-3);
    cursor: pointer;
    padding: 0;
    transition: color var(--t), transform var(--t);
}
.rating-input button:hover, .rating-input button.is-on { color: var(--warn); }
.rating-input button:hover { transform: scale(1.15); }

.prose { max-width: 780px; color: var(--ink-2); }
.prose h3 { color: var(--ink); margin: 28px 0 12px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--ink); }
.prose code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--surface-3);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13.5px;
    color: var(--brand-text);
}

/* ------------------------------------------------------------------ 8. калькулятор */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
.result-panel { position: sticky; top: calc(var(--header-h) + 18px); }
.result-main {
    padding: 26px;
    border-radius: var(--r-lg);
    background: linear-gradient(140deg, rgba(255, 122, 47, .16), rgba(53, 201, 192, .1)), var(--surface);
    border: 1px solid var(--brand-line);
    margin-bottom: 16px;
}
.result-main__value { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--ink); }
.result-main__label { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }
.result-cell { padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); }
.result-cell__v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.result-cell__k { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

.breakdown { display: grid; gap: 11px; margin-top: 18px; }
.breakdown__row { display: grid; gap: 5px; }
.breakdown__head { display: flex; justify-content: space-between; font-size: 13px; }
.breakdown__head span:last-child { color: var(--ink-2); font-weight: 700; }

/* ------------------------------------------------------------------ 9. STL-лаборатория */
.lab { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.lab__stage {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: radial-gradient(circle at 50% 40%, #182232, #0c1119);
    overflow: hidden;
}
.lab__canvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
.lab__canvas:active { cursor: grabbing; }
.lab__toolbar { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.lab__stats {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 9px 13px;
    border-radius: 10px;
    background: rgba(8, 11, 16, .7);
    backdrop-filter: blur(8px);
    font-size: 12px;
    color: rgba(255, 255, 255, .74);
    font-family: ui-monospace, Consolas, monospace;
}
.lab__drop {
    position: absolute;
    inset: 12px;
    display: grid;
    place-items: center;
    border: 2px dashed rgba(255, 255, 255, .22);
    border-radius: var(--r);
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, .72);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--t);
    background: rgba(8, 11, 16, .6);
}
.lab.is-drag .lab__drop { opacity: 1; }

.diag { display: grid; gap: 9px; }
.diag__item { display: flex; gap: 11px; padding: 12px 13px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); }
.diag__item--ok { border-left: 3px solid var(--ok); }
.diag__item--info { border-left: 3px solid var(--info); }
.diag__item--warn { border-left: 3px solid var(--warn); }
.diag__item--err { border-left: 3px solid var(--err); }
.diag__icon { flex: none; font-size: 16px; }
.diag__t { font-weight: 700; font-size: 14px; }
.diag__d { font-size: 13px; color: var(--ink-2); }

.sliced-view { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: #0c1119; }
.sliced-view canvas { width: 100%; height: 100%; }

.kv-list { display: grid; }
.kv-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-row > * { min-width: 0; }
.kv-row span:first-child { color: var(--ink-3); }
.kv-row b { font-weight: 700; }

/* ------------------------------------------------------------------ 10. принтеры, материалы */
.compare-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.article-card { display: flex; flex-direction: column; overflow: hidden; }
.article-card__media { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.article-card__body { padding: 18px; display: grid; gap: 9px; flex: 1; }
.article-card__meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.article-card p { color: var(--ink-2); font-size: 14.5px; }
.article-card__link { margin-top: auto; padding-top: 6px; color: var(--brand-text); font-weight: 700; font-size: 14px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 18px); padding: 20px; }
.toc a { display: block; padding: 6px 10px; margin-left: -10px; border-radius: 7px; color: var(--ink-2); font-size: 14px; }
.toc a:hover { color: var(--brand-text); background: var(--brand-soft); }

/* Оглавление статьи на узких экранах прячется за кнопку */
.toc-toggle { display: none; }
@media (max-width: 1100px) {
    .toc-toggle { display: block; }
    .toc--article { display: none; }
    .toc--article.is-open { display: block; }
}

/* ------------------------------------------------------------------ палитра поиска (cmd+k) */
.palette-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 20px;
    background: rgba(4, 6, 10, .68);
    backdrop-filter: blur(6px);
}
.palette-backdrop.is-open { display: flex; }
.palette {
    width: 100%;
    max-width: 620px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--sh-3);
    overflow: hidden;
}
.palette__input {
    width: 100%;
    padding: 17px 20px;
    border: none;
    border-bottom: 1px solid var(--line-2);
    background: none;
    font-size: 17px;
    font-weight: 600;
}
.palette__input:focus { outline: none; }
.palette__results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.palette__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14.5px;
}
.palette__item.is-active, .palette__item:hover { background: var(--surface-2); }
.palette__item svg { width: 38px; height: 38px; border-radius: 7px; flex: none; background: var(--surface-3); }
.palette__item-t { font-weight: 700; }
.palette__item-s { font-size: 12.5px; color: var(--ink-3); }
.palette__item mark { background: none; color: var(--brand-text); }
.palette__empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 14px; }
.palette__hint { padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); display: flex; gap: 14px; }
.palette__hint kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); font-family: inherit; font-size: 11px; }
.palette__group { padding: 10px 14px 5px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 800; }

/* ------------------------------------------------------------------ тосты */
.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 300;
    display: grid;
    gap: 10px;
    max-width: 330px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--sh-2);
    font-size: 14px;
    animation: toast-in .24s cubic-bezier(.2, .9, .3, 1);
}
.toast__icon { color: var(--ok); flex: none; }
.toast--info .toast__icon { color: var(--info); }
.toast--warn .toast__icon { color: var(--warn); }
.toast--err .toast__icon { color: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); padding: 18px 0 4px; }
.breadcrumbs a:hover { color: var(--brand-text); }

/* ------------------------------------------------------------------ анимации */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    border-radius: var(--r-lg);
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ адаптив */
@media (max-width: 1100px) {
    /* minmax(0, 1fr), а не 1fr: иначе колонка не может стать уже собственного
       min-content (например, из-за .tab с white-space: nowrap) и страница
       получает горизонтальную прокрутку на телефоне. */
    .model-layout, .lab, .article-layout { grid-template-columns: minmax(0, 1fr); }
    .side-panel, .result-panel, .toc, .filters { position: static; }
    .hero__grid { grid-template-columns: minmax(0, 1fr); }
    .hero__visual { order: -1; max-width: 460px; }
    .catalog { grid-template-columns: minmax(0, 1fr); }
    .filters { display: none; }
    .filters.is-open { display: block; }
    .calc-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .cta-band { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .burger { display: inline-flex; }
    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px 22px 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--sh-2);
        display: none;
    }
    .nav.is-open { display: flex; }
    .nav__link { padding: 12px 14px; font-size: 16px; }
    .header-search { display: none; }
}

@media (max-width: 560px) {
    body { font-size: 15px; }
    .container { padding: 0 16px; }
    .section { padding: 46px 0; }
    .hero { padding: 44px 0; }
    .footer-grid { grid-template-columns: 1fr; }
    .toasts { left: 16px; right: 16px; max-width: none; }
    .result-main__value { font-size: 34px; }
    .gallery__main { aspect-ratio: 1; }
}

@media print {
    .site-header, .site-footer, .toasts, .btn, .icon-btn, .filters, .tabs { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .table-wrap { border-color: #ccc; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}