/* Главная web-calculator.ru в новом виде (26.09.2026). Грузится до rd.css, поэтому префикс html body.rd. */

/* Hero: слева текст, справа калькулятор */
html body.rd .hm-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); grid-template-areas: "k c" "h c" "l c" "x c"; grid-template-rows: auto auto auto 1fr; column-gap: 64px; align-items: start; padding: 56px var(--gut) 64px; }
html body.rd .hm-hero__kicker { grid-area: k; margin: 8px 0 20px; }
html body.rd .hm-hero__title { grid-area: h; margin: 0 0 24px; font: 700 64px/1.02 var(--f-ui); letter-spacing: -2px; color: var(--ink); max-width: 640px; }
html body.rd .hm-hero__lead { grid-area: l; margin: 0 0 32px; max-width: 560px; font: 400 19px/1.55 var(--f-text); color: var(--ink); }
html body.rd .hm-hero__keys { grid-area: x; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
html body.rd .hm-hero__keys ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
html body.rd .hm-hero__keys li { margin: 0; padding: 0; }
html body.rd .hm-hero__keys li::before { content: none; }
html body.rd .hm-hero__keys kbd { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); font: 500 12px/1 var(--f-mono); color: var(--ink); }
html body.rd .hm-hero__calc { grid-area: c; justify-self: end; width: 100%; max-width: 460px; }

/* Каталог */
html body.rd .hm-cat { padding: 24px var(--gut) 40px; }
html body.rd .hm-cat > h2 { margin: 12px 0 12px; font: 700 44px/1.1 var(--f-ui); letter-spacing: -1.2px; color: var(--ink); }
html body.rd .hm-cat__lead { margin: 0 0 32px; max-width: 720px; font: 400 17px/1.55 var(--f-text); color: var(--ink); }
html body.rd .hm-cat__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
html body.rd .hm-card { background: var(--card); border-radius: 20px; padding: 24px; color: var(--ink); }
html body.rd .hm-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
html body.rd .hm-card__head h3 { margin: 0; padding: 0; font: 500 11px/1.3 var(--f-mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--mute); }
html body.rd .hm-card__head svg { flex: none; color: var(--ink); }
html body.rd .hm-card ul { margin: 0; padding: 0; list-style: none; }
html body.rd .hm-card li { margin: 0; padding: 0; border-top: 1px solid var(--line); }
html body.rd .hm-card li:first-child { border-top: 0; }
html body.rd .hm-card li::before { content: none; }
html body.rd .hm-card a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; font: 400 15px/1.35 var(--f-ui); color: var(--ink); text-decoration: none; }
html body.rd .hm-card a::after { content: "↗"; flex: none; font-size: 13px; color: var(--mute); transition: transform .15s; }
html body.rd .hm-card a:hover { color: var(--accent); }
html body.rd .hm-card a:hover::after { color: var(--accent); transform: translate(2px, -2px); }
html body.rd .hm-card--dark { background: var(--ink); color: #fff; }
html body.rd .hm-card--dark .hm-card__head h3 { color: rgba(255, 255, 255, .6); }
html body.rd .hm-card--dark .hm-card__head svg { color: #fff; }
html body.rd .hm-card--dark li { border-top-color: rgba(255, 255, 255, .14); }
html body.rd .hm-card--dark a { color: #fff; }
html body.rd .hm-card--dark a::after { color: rgba(255, 255, 255, .5); }
html body.rd .hm-card--dark a:hover, html body.rd .hm-card--dark a:hover::after { color: #B9BFFF; }

html body.rd .hm-cat__pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
html body.rd .hm-cat__pills .rd-pill { white-space: nowrap; }
html body.rd .hm-cat__pills .hm-pill--all { background: var(--ink); color: #fff; }
html body.rd .hm-cat__pills .hm-pill--all:hover { background: #2a2a2a; color: #fff; }
html body.rd .hm-cat__note { margin: 24px 0 0; max-width: 760px; font: 400 16px/1.6 var(--f-text); color: var(--mute); }

/* Реклама: карточка в строку */
html body.rd .hm-adv { padding: 16px var(--gut) 8px; }
html body.rd .hm-adv .adv-house { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "k s c" "t s c" "n s c"; align-items: center; justify-items: start; gap: 6px 48px !important; min-height: 0 !important; margin: 0 !important; padding: 32px 40px !important; background: var(--card) !important; border: 0 !important; border-radius: 24px !important; text-align: left !important; }
html body.rd .hm-adv .adv-house::before { content: "Реклама на сайте"; grid-area: k; font: 500 11px/1.3 var(--f-mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--mute); }
html body.rd .hm-adv .adv-house__title { grid-area: t; font: 700 26px/1.2 var(--f-ui) !important; letter-spacing: -.4px; color: var(--ink) !important; }
html body.rd .hm-adv .adv-house__note { grid-area: n; font: 400 13px/1.4 var(--f-ui) !important; color: var(--mute) !important; }
html body.rd .hm-adv .adv-house__more { color: var(--ink) !important; }
html body.rd .hm-adv .adv-house__stats { grid-area: s; gap: 8px 40px !important; text-align: left; }
html body.rd .hm-adv .adv-house__stats li { margin: 0; padding: 0; }
html body.rd .hm-adv .adv-house__stats li::before { content: none; }
html body.rd .hm-adv .adv-house__stats b { font: 500 28px/1.1 var(--f-mono) !important; color: var(--ink) !important; letter-spacing: -.5px; }
html body.rd .hm-adv .adv-house__stats span { font: 400 12px/1.3 var(--f-ui) !important; color: var(--mute) !important; }
html body.rd .hm-adv .adv-house__cta { grid-area: c; justify-self: end; padding: 16px 24px !important; border-radius: 14px !important; background: var(--ink) !important; color: #fff !important; text-decoration: none !important; font: 600 15px/1 var(--f-ui) !important; white-space: nowrap; }
html body.rd .hm-adv .adv-house__cta:hover { background: #2a2a2a !important; color: #fff !important; }

/* Статья: оглавление слева без карточки, тело без карточки */
html body.rd .rd-article:has(.hm-toc) { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; padding-top: 56px; }
html body.rd .rd-article:has(.hm-toc) .rd-article__aside { order: -1; }
html body.rd .rd-article:has(.hm-toc) .rd-article__body.box.howto { background: transparent; border-radius: 0; padding: 0; }
html body.rd .hm-toc-d { margin: 0; }
html body.rd .hm-toc-d > summary { display: none; }
html body.rd .rd-toc.hm-toc { background: transparent; padding: 0; border-radius: 0; }

/* FAQ: каждый вопрос отдельной карточкой */
html body.rd .rd-article:has(.hm-toc) .faq { background: transparent; padding: 0; border-radius: 0; margin-top: 48px; }
html body.rd .rd-article:has(.hm-toc) .faq h3.button.button-dropdown { margin: 8px 0 0; padding: 22px 24px; background: var(--card); border: 0; border-radius: 16px; align-items: center; }
html body.rd .rd-article:has(.hm-toc) .faq h3.button.button-dropdown:first-child { margin-top: 0; }
html body.rd .rd-article:has(.hm-toc) .faq h3.button.button-dropdown.active { border-radius: 16px 16px 0 0; }
html body.rd .rd-article:has(.hm-toc) .faq h3.button .dropdown__icon { display: none; }
html body.rd .rd-article:has(.hm-toc) .faq h3.button::after { content: "+"; order: 2; flex: none; width: 24px; text-align: center; font: 400 26px/1 var(--f-ui); color: var(--ink); }
html body.rd .rd-article:has(.hm-toc) .faq h3.button.active::after { content: "−"; }
html body.rd .rd-article:has(.hm-toc) .faq .dropdown__content { padding: 0 64px 20px 24px; background: var(--card); border-radius: 0 0 16px 16px; }
html body.rd .rd-article:has(.hm-toc) .faq .dropdown__content p:last-child { margin-bottom: 0; }

@media (max-width: 1280px) {
    html body.rd .hm-hero__title { font-size: 52px; letter-spacing: -1.5px; }
    html body.rd .hm-cat__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    html body.rd .hm-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "k" "h" "c" "l" "x"; grid-template-rows: none; padding-top: 40px; }
    html body.rd .hm-hero__calc { justify-self: center; margin: 0 0 32px; }
    html body.rd .hm-adv .adv-house { grid-template-columns: minmax(0, 1fr); grid-template-areas: "k" "t" "s" "c" "n"; gap: 12px !important; }
    html body.rd .hm-adv .adv-house__cta { justify-self: start; }
    html body.rd .rd-article:has(.hm-toc) { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 40px; }
    html body.rd .hm-toc-d { background: var(--card); border-radius: 16px; }
    html body.rd .hm-toc-d > summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; list-style: none; font: 600 15px/1.3 var(--f-ui); color: var(--ink); }
    html body.rd .hm-toc-d > summary::-webkit-details-marker { display: none; }
    html body.rd .hm-toc-d > summary::after { content: "+"; font: 400 22px/1 var(--f-ui); }
    html body.rd .hm-toc-d[open] > summary::after { content: "−"; }
    html body.rd .hm-toc-d .rd-toc.hm-toc { padding: 0 20px 16px; }
    html body.rd .hm-toc-d .content-links__title { display: none; }
}

@media (max-width: 639px) {
    html body.rd .hm-hero { padding: 24px 16px 32px; }
    html body.rd .hm-hero__kicker { margin: 0 0 14px; }
    html body.rd .hm-hero__title { font-size: 36px; letter-spacing: -1px; margin-bottom: 20px; }
    html body.rd .hm-hero__calc { margin-bottom: 24px; }
    html body.rd .hm-hero__lead { font-size: 17px; margin: 0; }
    html body.rd .hm-hero__keys { display: none; }
    html body.rd .hm-cat { padding: 16px 16px 32px; }
    html body.rd .hm-cat > h2 { font-size: 30px; letter-spacing: -.6px; }
    html body.rd .hm-cat__lead { font-size: 16px; margin-bottom: 20px; }
    html body.rd .hm-cat__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    html body.rd .hm-card { padding: 20px; }
    html body.rd .hm-cat__pills { flex-wrap: nowrap; overflow-x: auto; margin: 20px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
    html body.rd .hm-cat__pills::-webkit-scrollbar { display: none; }
    html body.rd .hm-adv { padding: 8px 16px; }
    html body.rd .hm-adv .adv-house { padding: 24px 20px !important; }
    html body.rd .hm-adv .adv-house__title { font-size: 22px !important; }
    html body.rd .hm-adv .adv-house__stats { gap: 8px 16px !important; }
    html body.rd .hm-adv .adv-house__stats b { font-size: 20px !important; }
    html body.rd .rd-article:has(.hm-toc) { padding: 24px 16px; }
    html body.rd .rd-article:has(.hm-toc) .faq h3.button.button-dropdown { padding: 18px 16px; }
    html body.rd .rd-article:has(.hm-toc) .faq .dropdown__content { padding: 0 16px 18px; }
}

/* Таблица в статье: одна рамка. Скругление и фон держит обёртка, у ячеек шапки
   снимаются радиусы 20px и верхняя граница из старого partial-styles.css. */
html body.rd .rd-article:has(.hm-toc) .table-scroll { overflow-x: auto; border-radius: 14px; background: var(--tile); }
html body.rd .rd-article:has(.hm-toc) .table-scroll > table { border-collapse: separate; border-spacing: 0; border-radius: 0; overflow: visible; background: transparent; margin: 0; }
html body.rd .rd-article:has(.hm-toc) .table-scroll th,
html body.rd .rd-article:has(.hm-toc) .table-scroll td { border-radius: 0; border-top: 0; }
html body.rd .rd-article:has(.hm-toc) .table-scroll tbody tr:last-child td { border-bottom: 0; }
