/*
RaschetLab Calculator Template Engine v1.4.1
Canonical calculator visual layer.

Responsibility:
- calculator page geometry
- typography, spacing, cards, surfaces
- form/result visual styling
- mobile responsive presentation
- informational blocks below the calculator

No calculation logic lives here.
All rules are scoped to .rl-calculator-page wherever possible.
*/

:root{
    --rl-navy:#10294a;
    --rl-text:#172033;
    --rl-muted:#687386;
    --rl-border:#e5eaf2;
    --rl-surface:#ffffff;
    --rl-surface-soft:#f8fafc;
    --rl-accent:#17b9b0;
    --rl-accent-soft:#eefbf9;
    --rl-radius:14px;
    --rl-shadow:0 10px 30px rgba(16,41,74,.055);
    --rl-container:920px;
}

/* ---------- Page ---------- */
.rl-calculator-page{
    color:var(--rl-text);
}
.rl-calculator-page .site-main,
.rl-calculator-page main{
    overflow:visible;
}
.rl-calculator-page .wp-site-blocks{
    padding-top:0 !important;
}
.rl-calculator-page .wp-site-blocks > main,
.rl-calculator-page main.wp-block-group,
.rl-calculator-page #main,
.rl-calculator-page .site-main{
    margin-top:0 !important;
    padding-top:0 !important;
}
.rl-calculator-page .entry-content,
.rl-calculator-page .wp-block-post-content{
    max-width:var(--rl-container);
    margin-left:auto;
    margin-right:auto;
    margin-top:0 !important;
    padding-top:0 !important;
}
.rl-calculator-page .entry-title,
.rl-calculator-page .wp-block-post-title{
    width:min(1180px, calc(100vw - 40px)) !important;
    max-width:none !important;
    margin:18px auto 12px !important;
    padding-top:0 !important;
    font-size:34px;
    line-height:1.08;
    letter-spacing:-.03em;
    color:var(--rl-navy);
}

/* ---------- Calculator form ---------- */
.rl-calculator-page .rl-renderer{
    max-width:700px;
    margin:0 auto;
}
.rl-calculator-page .rl-renderer-form{
    display:grid;
    gap:13px;
    padding:22px;
    border:1px solid var(--rl-border);
    border-radius:var(--rl-radius);
    background:var(--rl-surface);
    box-shadow:var(--rl-shadow);
}
.rl-calculator-page .rl-renderer-title{
    margin:0 0 2px;
    font-size:21px;
    line-height:1.15;
    font-weight:720;
    color:var(--rl-navy);
}
.rl-calculator-page .rl-renderer-field{
    display:grid;
    gap:7px;
}
.rl-calculator-page .rl-renderer-label{
    font-size:15px;
    line-height:1.4;
    font-weight:650;
    color:var(--rl-text);
}
.rl-calculator-page .rl-renderer-input-wrap{
    display:flex;
    align-items:center;
    gap:8px;
}
.rl-calculator-page .rl-renderer-input{
    width:100%;
    min-height:42px;
    padding:8px 11px;
    border:1px solid #cfd6e3;
    border-radius:9px;
    background:#fff;
    color:var(--rl-text);
    font-size:16px;
    box-sizing:border-box;
    transition:border-color .18s ease, box-shadow .18s ease;
}
.rl-calculator-page .rl-renderer-input:focus{
    outline:none;
    border-color:var(--rl-accent);
    box-shadow:0 0 0 3px rgba(19,184,173,.12);
}
.rl-calculator-page .rl-renderer-unit{
    min-width:40px;
    white-space:nowrap;
    color:var(--rl-muted);
    font-size:14px;
}
.rl-calculator-page .rl-renderer-choice{
    margin:0;
    padding:0;
    border:0;
}
.rl-calculator-page .rl-renderer-choice-list{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.rl-calculator-page .rl-renderer-choice-option{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:7px 9px;
    border:1px solid var(--rl-border);
    border-radius:10px;
    background:var(--rl-surface-soft);
    cursor:pointer;
    text-align:center;
    font-size:14px;
    line-height:1.25;
}
.rl-calculator-page .rl-renderer-choice-option:has(input:checked){
    border-color:var(--rl-accent);
    background:rgba(19,184,173,.07);
    box-shadow:0 0 0 2px rgba(19,184,173,.08);
}
.rl-calculator-page .rl-renderer-choice-option input{
    margin:0 7px 0 0;
    accent-color:var(--rl-accent);
}
.rl-calculator-page .rl-renderer-submit{
    min-height:44px;
    margin-top:2px;
    padding:10px 16px;
    border:0;
    border-radius:10px;
    background:var(--rl-accent);
    color:#fff;
    font-size:16px;
    font-weight:750;
    cursor:pointer;
    box-shadow:0 6px 16px rgba(19,184,173,.18);
}
.rl-calculator-page .rl-renderer-status{
    min-height:20px;
    color:var(--rl-muted);
    font-size:14px;
}

/* ---------- Result ---------- */
.rl-calculator-page .rl-result-wrapper{
    max-width:700px;
    margin:14px auto 0;
    padding:20px;
    border:1px solid var(--rl-border);
    border-radius:var(--rl-radius);
    background:#fff;
    box-shadow:var(--rl-shadow);
}
.rl-calculator-page .rl-result-title{
    margin:0 0 14px;
    font-size:21px;
    line-height:1.15;
    color:var(--rl-navy);
}
.rl-calculator-page .rl-result-grid{
    gap:12px;
}
.rl-calculator-page .rl-result-card{
    min-width:0;
    padding:14px;
    border:1px solid var(--rl-border);
    border-radius:12px;
    background:#fff;
    box-shadow:none;
}
.rl-calculator-page .rl-result-card-label{
    min-height:2.8em;
    color:var(--rl-muted);
    font-size:12px;
    line-height:1.25;
}
.rl-calculator-page .rl-result-card-value{
    margin-top:8px;
    color:var(--rl-navy);
    font-size:clamp(18px,1.7vw,24px);
    font-weight:750;
    line-height:1.05;
    overflow-wrap:anywhere;
}
.rl-calculator-page .rl-result-exact{
    margin-top:14px;
    color:var(--rl-muted);
    font-size:13px;
}

/* ---------- Page layout ---------- */
.rl-calculator-page .rl-page-shell{
    width:min(1180px, calc(100vw - 40px)) !important;
    max-width:none !important;
    margin-left:50% !important;
    margin-right:0 !important;
    transform:translateX(-50%);
    margin-top:0 !important;
}
.rl-calculator-page .rl-page-layout{
    grid-template-columns:minmax(0,1fr) 300px;
    gap:24px;
    width:min(1180px, calc(100% - 32px));
    margin-top:0;
}
.rl-calculator-page .rl-page-top{
    grid-template-columns:minmax(0,1fr) 300px;
    gap:24px;
}
.rl-calculator-page .rl-page-main{
    min-width:0;
}
.rl-calculator-page .rl-page-slot{
    margin-bottom:16px;
}
.rl-calculator-page .rl-page-slot--intro{margin-bottom:10px}
.rl-calculator-page .rl-page-slot--calculator{margin-bottom:14px}
.rl-calculator-page .rl-page-intro{
    color:var(--rl-muted);
    font-size:15px;
    line-height:1.5;
    background:transparent;
    border:0;
    padding:2px 2px 4px;
}
.rl-calculator-page .rl-page-slot-inner,
.rl-calculator-page .rl-page-card,
.rl-calculator-page .rl-sidebar-card,
.rl-calculator-page .rl-recommendation-slot,
.rl-calculator-page .rl-next-steps,
.rl-calculator-page .rl-formula-block{
    border:1px solid var(--rl-border);
    border-radius:14px;
    background:#fff;
    box-shadow:0 8px 26px rgba(16,41,74,.045);
}
.rl-calculator-page .rl-page-slot-inner,
.rl-calculator-page .rl-page-card{
    padding:20px;
}
.rl-calculator-page .rl-page-slot-inner > h2,
.rl-calculator-page .rl-page-section-head h2,
.rl-calculator-page .rl-page-card > h2{
    margin-top:0;
    font-size:24px;
    line-height:1.2;
    color:var(--rl-navy);
}

/* Calculator fills main column */
.rl-calculator-page .rl-page-slot--calculator .rl-renderer,
.rl-calculator-page .rl-page-slot--calculator .rl-renderer-form,
.rl-calculator-page .rl-page-slot--calculator .rl-result-wrapper{
    width:100%;
    max-width:none;
}

/* ---------- Formula ---------- */
.rl-calculator-page .rl-formula-block{
    padding:16px 18px;
}
.rl-calculator-page .rl-formula-block h2{
    margin:0 0 8px;
    font-size:20px;
    color:var(--rl-navy);
}
.rl-calculator-page .rl-formula-block > p,
.rl-calculator-page .rl-formula-head p{
    margin-bottom:12px;
    color:var(--rl-muted);
    font-size:14px;
    line-height:1.45;
}
.rl-calculator-page .rl-formula-steps{
    display:grid;
    grid-template-columns:1fr 1fr !important;
    gap:10px;
}
.rl-calculator-page .rl-formula-step{
    min-height:76px;
    min-width:0;
    padding:13px;
    border:1px solid #edf1f6;
    background:#fbfcfe;
}
.rl-calculator-page .rl-formula-number{
    background:var(--rl-accent-soft);
    color:var(--rl-accent);
}
.rl-calculator-page .rl-formula-step h3{
    font-size:14px;
}
.rl-calculator-page .rl-formula-step p{
    font-size:13px;
}

/* ---------- Next steps ---------- */
.rl-calculator-page .rl-next-steps{
    padding:16px 18px;
}
.rl-calculator-page .rl-next-steps h2{
    font-size:20px;
    color:var(--rl-navy);
}
.rl-calculator-page .rl-next-steps-head p,
.rl-calculator-page .rl-step-card p{
    color:var(--rl-muted);
    font-size:14px;
}
.rl-calculator-page .rl-next-steps-grid{
    display:grid;
    gap:12px;
    align-items:stretch;
}
.rl-calculator-page .rl-page-lower-actions .rl-next-steps-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
}
.rl-calculator-page .rl-step-card{
    min-height:160px;
    padding:14px;
    background:#fff;
    border:1px solid #e9eef5;
}
.rl-calculator-page .rl-step-card h3{
    font-size:15px;
}
.rl-calculator-page .rl-step-icon{
    background:var(--rl-accent-soft);
    color:var(--rl-accent);
}
.rl-calculator-page .rl-step-card button{
    width:100%;
    min-height:38px;
    background:var(--rl-navy);
    color:#fff;
    font-size:13px;
}

/* ---------- Recommendation ---------- */
.rl-calculator-page .rl-recommendation-slot{
    display:block;
    padding:18px 20px;
    background:linear-gradient(135deg,#f4fbfb 0%,#ffffff 72%);
}
.rl-calculator-page .rl-rec-kicker{
    color:var(--rl-accent);
}
.rl-calculator-page .rl-rec-button{
    background:var(--rl-accent);
    color:#fff;
}

/* ---------- Sidebar ---------- */
.rl-calculator-page .rl-page-sidebar{
    display:grid;
    gap:14px;
}
.rl-calculator-page .rl-page-sidebar > *{
    margin:0;
}
.rl-calculator-page .rl-sidebar-card{
    padding:17px;
}
.rl-calculator-page .rl-sidebar-card h3{
    margin-top:0;
    font-size:18px;
    color:var(--rl-navy);
}
.rl-calculator-page .rl-sidebar-card,
.rl-calculator-page .rl-sidebar-card p,
.rl-calculator-page .rl-sidebar-card li{
    font-size:14px;
}
.rl-calculator-page .rl-sidebar-card--materials{
    background:var(--rl-accent-soft);
    border-color:#d9f2ef;
}

/* ---------- Articles ---------- */
.rl-calculator-page .rl-page-article-grid{
    gap:12px;
}
.rl-calculator-page .rl-page-article{
    overflow:hidden;
    border:1px solid #e8edf4;
    border-radius:12px;
    background:#fff;
}
.rl-calculator-page .rl-page-article--featured{
    background:linear-gradient(135deg,#f5fbfb 0%,#fff 70%);
}
.rl-calculator-page .rl-page-kicker{
    color:var(--rl-accent);
    font-size:12px;
    font-weight:700;
}
.rl-calculator-page .rl-page-article h3{
    color:var(--rl-navy);
    font-size:17px;
}
.rl-calculator-page .rl-page-article p{
    color:var(--rl-muted);
    font-size:14px;
    line-height:1.5;
}
.rl-calculator-page .rl-page-section-link{
    color:var(--rl-accent);
    font-size:14px;
    font-weight:700;
}

/* ---------- Related / FAQ ---------- */
.rl-calculator-page .rl-page-related-grid{
    gap:10px;
}
.rl-calculator-page .rl-related-card{
    border:1px solid #e8edf4;
    border-radius:11px;
    background:var(--rl-surface-soft);
    color:var(--rl-navy);
    font-weight:650;
}
.rl-calculator-page .rl-page-faq{
    gap:8px;
}
.rl-calculator-page .rl-page-faq details{
    border:1px solid #e8edf4;
    border-radius:10px;
    background:#fff;
}
.rl-calculator-page .rl-page-faq summary{
    color:var(--rl-navy);
    font-weight:650;
}
.rl-calculator-page .rl-page-faq p{
    margin:12px 0 0;
    color:var(--rl-muted);
    font-size:14px;
    line-height:1.55;
}

/* ---------- Theme cleanup v1.4.0 ---------- */
.rl-calculator-page .wp-block-post-terms,
.rl-calculator-page .wp-block-post-author,
.rl-calculator-page .wp-block-post-author-name,
.rl-calculator-page .wp-block-post-date,
.rl-calculator-page .wp-block-post-navigation-link{
    display:none !important;
}
.rl-calculator-page main.wp-block-group > .wp-block-query,
.rl-calculator-page main.wp-block-group > .wp-block-group:has(.wp-block-query),
.rl-calculator-page main.wp-block-group > .wp-block-columns:has(.wp-block-query),
.rl-calculator-page .wp-block-heading:has(+ .wp-block-query){
    display:none !important;
}
.rl-calculator-page main.wp-block-group > .wp-block-spacer:has(+ .wp-block-query),
.rl-calculator-page main.wp-block-group > .wp-block-query + .wp-block-spacer{
    display:none !important;
}
.rl-calculator-page .wp-block-post-content{
    margin-block-start:0 !important;
}

/* =========================================================
   v1.4.1 — Mobile Compact UI
   Visual-only patch. Calculator logic and result contracts untouched.
   ========================================================= */
@media(max-width:980px){
    .rl-calculator-page .rl-page-layout,
    .rl-calculator-page .rl-page-top{
        grid-template-columns:1fr;
    }
    .rl-calculator-page .rl-page-shell{
        width:min(760px, calc(100vw - 28px)) !important;
    }
    .rl-calculator-page .entry-title,
    .rl-calculator-page .wp-block-post-title{
        width:min(760px, calc(100vw - 28px)) !important;
    }
}

@media(max-width:640px){

    .rl-calculator-page{
        --rl-mobile-gap:10px;
    }

    /* Keep calculator title readable but reduce top-screen usage */
    .rl-calculator-page .entry-title,
    .rl-calculator-page .wp-block-post-title{
        width:calc(100vw - 28px) !important;
        margin:10px auto 7px !important;
        font-size:25px !important;
        line-height:1.08 !important;
        letter-spacing:-.02em;
    }

    .rl-calculator-page .rl-page-shell{
        width:calc(100vw - 24px) !important;
        margin-left:50% !important;
        transform:translateX(-50%);
    }

    /* Main rhythm: smaller gaps between page blocks */
    .rl-calculator-page .rl-page-top{
        gap:10px;
    }
    .rl-calculator-page .rl-page-slot{
        margin-bottom:8px;
    }
    .rl-calculator-page .rl-page-slot--intro{
        margin-bottom:6px;
    }
    .rl-calculator-page .rl-page-slot--calculator{
        margin-bottom:10px;
    }

    .rl-calculator-page .rl-page-intro{
        padding:0 2px;
        margin-bottom:5px;
        font-size:12.5px;
        line-height:1.38;
    }

    /* Preserve calculator form usability */
    .rl-calculator-page .rl-renderer-form{
        padding:16px;
        gap:11px;
        border-radius:13px;
    }
    .rl-calculator-page .rl-renderer-title{
        font-size:20px;
    }
    .rl-calculator-page .rl-renderer-label{
        font-size:14px;
    }
    .rl-calculator-page .rl-renderer-input{
        min-height:40px;
    }
    .rl-calculator-page .rl-renderer-submit{
        min-height:42px;
    }

    /* Keep two-column result cards and strong numbers */
    .rl-calculator-page .rl-result-wrapper{
        padding:15px;
        margin-top:10px;
        border-radius:13px;
    }
    .rl-calculator-page .rl-result-title{
        margin-bottom:11px;
        font-size:19px;
    }
    .rl-calculator-page .rl-result-grid{
        grid-template-columns:1fr 1fr;
        gap:8px;
    }
    .rl-calculator-page .rl-result-card{
        padding:10px 11px;
        border-radius:10px;
    }
    .rl-calculator-page .rl-result-card-label{
        min-height:2.4em;
        font-size:11px;
        line-height:1.2;
    }
    .rl-calculator-page .rl-result-card-value{
        margin-top:6px;
        font-size:18px;
    }

    /* Secondary blocks become substantially shorter */
    .rl-calculator-page .rl-page-card,
    .rl-calculator-page .rl-formula-block,
    .rl-calculator-page .rl-next-steps,
    .rl-calculator-page .rl-recommendation-slot,
    .rl-calculator-page .rl-sidebar-card{
        padding:12px;
        border-radius:12px;
        box-shadow:0 4px 14px rgba(16,41,74,.035);
    }

    .rl-calculator-page .rl-formula-block h2,
    .rl-calculator-page .rl-next-steps h2,
    .rl-calculator-page .rl-page-section-head h2,
    .rl-calculator-page .rl-page-card > h2,
    .rl-calculator-page .rl-page-slot-inner > h2{
        margin-bottom:8px;
        font-size:18px;
        line-height:1.2;
    }

    /* "Как мы рассчитали?" */
    .rl-calculator-page .rl-formula-head p{
        margin:3px 0 8px;
        font-size:12px;
        line-height:1.35;
    }
    .rl-calculator-page .rl-formula-steps{
        grid-template-columns:1fr !important;
        gap:6px;
    }
    .rl-calculator-page .rl-formula-step{
        min-height:0;
        padding:8px 9px;
        gap:8px;
    }
    .rl-calculator-page .rl-formula-number{
        flex-basis:24px;
        width:24px;
        height:24px;
        font-size:11px;
    }
    .rl-calculator-page .rl-formula-step h3{
        margin:0 0 2px;
        font-size:13.5px;
        line-height:1.2;
    }
    .rl-calculator-page .rl-formula-step p{
        margin:0;
        font-size:12px;
        line-height:1.32;
    }

    /* "Что делать дальше?" */
    .rl-calculator-page .rl-next-steps-grid,
    .rl-calculator-page .rl-page-lower-actions .rl-next-steps-grid{
        grid-template-columns:1fr !important;
        gap:7px;
    }
    .rl-calculator-page .rl-step-card{
        min-height:0 !important;
        padding:10px 11px;
    }
    .rl-calculator-page .rl-step-icon{
        width:30px;
        height:30px;
    }
    .rl-calculator-page .rl-step-card h3{
        margin:7px 0 4px;
        font-size:15px;
        line-height:1.2;
    }
    .rl-calculator-page .rl-step-card p{
        margin-bottom:8px;
        font-size:12.5px;
        line-height:1.35;
    }
    .rl-calculator-page .rl-step-card button{
        min-height:38px;
        font-size:12px;
    }

    /* Partner/recommendation */
    .rl-calculator-page .rl-recommendation-slot{
        padding:12px;
    }
    .rl-calculator-page .rl-rec-button{
        width:100%;
        margin-top:9px;
    }

    /* Tips / popular support */
    .rl-calculator-page .rl-page-sidebar{
        gap:7px;
    }
    .rl-calculator-page .rl-sidebar-card h3,
    .rl-calculator-page .rl-sidebar-card--tips h3{
        margin-bottom:5px;
        font-size:16px;
    }
    .rl-calculator-page .rl-sidebar-card--tips ul{
        margin:6px 0 0;
        padding-left:17px;
    }
    .rl-calculator-page .rl-sidebar-card--tips li{
        margin-bottom:4px;
        font-size:12px;
        line-height:1.35;
    }

    /* Article cards: compact horizontal format */
    .rl-calculator-page .rl-page-article-grid{
        grid-template-columns:1fr !important;
        gap:7px;
    }
    .rl-calculator-page .rl-page-article{
        display:grid;
        grid-template-columns:82px minmax(0,1fr);
        grid-template-rows:auto auto auto;
        column-gap:9px;
        align-items:start;
        padding:9px;
        min-height:92px;
    }
    .rl-calculator-page .rl-page-article-thumb{
        grid-column:1;
        grid-row:1 / span 3;
        width:82px;
        height:74px;
        margin:0;
        border-radius:8px;
    }
    .rl-calculator-page .rl-page-article .rl-page-kicker,
    .rl-calculator-page .rl-page-article h3,
    .rl-calculator-page .rl-page-article p{
        grid-column:2;
        margin-left:0;
        margin-right:0;
    }
    .rl-calculator-page .rl-page-article .rl-page-kicker{
        margin:0 0 2px;
        font-size:10px;
    }
    .rl-calculator-page .rl-page-article h3{
        margin:0 0 3px;
        font-size:14px;
        line-height:1.18;
    }
    .rl-calculator-page .rl-page-article p{
        margin:0;
        font-size:11.5px;
        line-height:1.3;
    }

    /* Useful calculators */
    .rl-calculator-page .rl-page-related-grid{
        grid-template-columns:1fr 1fr !important;
        gap:6px;
    }
    .rl-calculator-page .rl-related-card{
        min-height:50px;
        padding:8px 9px;
        display:flex;
        align-items:center;
        font-size:12px;
        line-height:1.2;
    }

    .rl-calculator-page .rl-sidebar-card--popular .rl-sidebar-links{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:6px;
    }
    .rl-calculator-page .rl-sidebar-card--popular .rl-sidebar-links li{
        margin:0;
        padding:8px;
        border:1px solid #e8edf4;
        border-radius:9px;
        background:#fbfcfe;
        font-size:12px;
        line-height:1.2;
    }

    /* FAQ / tips */
    .rl-calculator-page .rl-page-faq{
        gap:6px;
    }
    .rl-calculator-page .rl-page-faq details{
        padding:9px 10px;
    }
    .rl-calculator-page .rl-page-faq summary{
        font-size:13px;
        line-height:1.3;
    }
    .rl-calculator-page .rl-page-faq p{
        margin-top:8px;
        font-size:12px;
        line-height:1.4;
    }

    /* Reduce footer-adjacent whitespace generated by calculator content */
    .rl-calculator-page .rl-page-lower{
        padding-top:0;
    }
    .rl-calculator-page .rl-page-card > h2{
        margin-bottom:7px;
    }
}

@media(max-width:380px){
    .rl-calculator-page .entry-title,
    .rl-calculator-page .wp-block-post-title{
        font-size:23px !important;
    }
    .rl-calculator-page .rl-page-related-grid,
    .rl-calculator-page .rl-sidebar-card--popular .rl-sidebar-links{
        grid-template-columns:1fr !important;
    }
    .rl-calculator-page .rl-page-article{
        grid-template-columns:76px minmax(0,1fr);
    }
    .rl-calculator-page .rl-page-article-thumb{
        width:76px;
        height:70px;
    }
}

/* ---------- Legacy template shortcode compatibility ---------- */
.rl-template{
    max-width:var(--rl-container);
    margin:auto;
}
.rl-block{
    padding:24px;
    margin:16px 0;
    border:1px solid var(--rl-border);
    border-radius:var(--rl-radius);
    background:#fff;
}

/* =========================================================
   Mobile Content Compact v1.4.2
   Scope: secondary content only on phones. Desktop and
   calculator form/result geometry are intentionally untouched.
   ========================================================= */
@media(max-width:640px){

    /* Tighter vertical rhythm after result */
    .rl-calculator-page .rl-page-lower,
    .rl-calculator-page .rl-page-lower-actions{
        padding-top:0 !important;
    }
    .rl-calculator-page .rl-page-lower > *,
    .rl-calculator-page .rl-page-lower-actions > *{
        margin-top:0 !important;
        margin-bottom:9px !important;
    }

    /* HOW WE CALCULATED: compact but still readable */
    .rl-calculator-page .rl-formula-block{
        padding:11px !important;
    }
    .rl-calculator-page .rl-formula-block h2,
    .rl-calculator-page .rl-formula-head h2{
        margin:0 0 7px !important;
        font-size:18px !important;
        line-height:1.15 !important;
    }
    .rl-calculator-page .rl-formula-head p{
        margin:0 0 7px !important;
        font-size:11.5px !important;
        line-height:1.3 !important;
    }
    .rl-calculator-page .rl-formula-steps{
        gap:5px !important;
    }
    .rl-calculator-page .rl-formula-step{
        min-height:0 !important;
        padding:7px 8px !important;
        gap:7px !important;
        border-radius:10px !important;
    }
    .rl-calculator-page .rl-formula-number{
        flex:0 0 22px !important;
        width:22px !important;
        height:22px !important;
        font-size:10.5px !important;
    }
    .rl-calculator-page .rl-formula-step h3{
        margin:0 0 1px !important;
        font-size:13px !important;
        line-height:1.16 !important;
    }
    .rl-calculator-page .rl-formula-step p{
        margin:0 !important;
        font-size:11.5px !important;
        line-height:1.28 !important;
    }

    /* WHAT NEXT: reduce each card by roughly a third */
    .rl-calculator-page .rl-next-steps{
        padding:11px !important;
    }
    .rl-calculator-page .rl-next-steps h2{
        margin:0 0 7px !important;
        font-size:18px !important;
    }
    .rl-calculator-page .rl-next-steps-grid,
    .rl-calculator-page .rl-page-lower-actions .rl-next-steps-grid{
        gap:6px !important;
    }
    .rl-calculator-page .rl-step-card{
        min-height:0 !important;
        padding:9px 10px !important;
        border-radius:10px !important;
    }
    .rl-calculator-page .rl-step-icon{
        width:27px !important;
        height:27px !important;
        margin-bottom:0 !important;
    }
    .rl-calculator-page .rl-step-card h3{
        margin:5px 0 3px !important;
        font-size:14px !important;
        line-height:1.18 !important;
    }
    .rl-calculator-page .rl-step-card p{
        margin:0 0 7px !important;
        font-size:11.5px !important;
        line-height:1.3 !important;
    }
    .rl-calculator-page .rl-step-card button,
    .rl-calculator-page .rl-step-card .button,
    .rl-calculator-page .rl-step-card a[class*="button"]{
        min-height:34px !important;
        padding:7px 9px !important;
        font-size:11.5px !important;
        line-height:1.15 !important;
    }

    /* USEFUL ARTICLES: horizontal media cards on phones */
    .rl-calculator-page .rl-page-slot--articles .rl-page-card,
    .rl-calculator-page .rl-page-card:has(.rl-page-article-grid){
        padding:11px !important;
    }
    .rl-calculator-page .rl-page-article-grid{
        grid-template-columns:1fr !important;
        gap:6px !important;
    }
    .rl-calculator-page .rl-page-article{
        display:grid !important;
        grid-template-columns:88px minmax(0,1fr) !important;
        grid-template-rows:auto auto auto !important;
        column-gap:9px !important;
        row-gap:0 !important;
        min-height:0 !important;
        padding:8px !important;
        border-radius:10px !important;
        align-items:start !important;
    }
    .rl-calculator-page .rl-page-article-thumb,
    .rl-calculator-page .rl-page-article img{
        grid-column:1 !important;
        grid-row:1 / span 4 !important;
        width:88px !important;
        height:76px !important;
        min-height:76px !important;
        margin:0 !important;
        object-fit:cover !important;
        border-radius:7px !important;
    }
    .rl-calculator-page .rl-page-article .rl-page-kicker,
    .rl-calculator-page .rl-page-article h3,
    .rl-calculator-page .rl-page-article p,
    .rl-calculator-page .rl-page-article a:not(.rl-page-article-thumb){
        grid-column:2 !important;
    }
    .rl-calculator-page .rl-page-article .rl-page-kicker{
        margin:0 0 2px !important;
        font-size:9.5px !important;
    }
    .rl-calculator-page .rl-page-article h3{
        margin:0 0 3px !important;
        font-size:13.5px !important;
        line-height:1.17 !important;
    }
    .rl-calculator-page .rl-page-article p{
        display:-webkit-box !important;
        -webkit-line-clamp:2 !important;
        -webkit-box-orient:vertical !important;
        overflow:hidden !important;
        margin:0 0 3px !important;
        font-size:10.5px !important;
        line-height:1.28 !important;
    }
    .rl-calculator-page .rl-page-article a{
        font-size:11px !important;
        line-height:1.2 !important;
    }

    /* USEFUL CALCULATORS: compact two-column tiles */
    .rl-calculator-page .rl-page-card:has(.rl-page-related-grid){
        padding:11px !important;
    }
    .rl-calculator-page .rl-page-related-grid{
        grid-template-columns:1fr 1fr !important;
        gap:6px !important;
    }
    .rl-calculator-page .rl-related-card{
        min-height:44px !important;
        padding:7px 8px !important;
        border-radius:9px !important;
        font-size:11.5px !important;
        line-height:1.2 !important;
    }

    /* Popular calculators list in the sidebar/lower section */
    .rl-calculator-page .rl-sidebar-card--popular{
        padding:11px !important;
    }
    .rl-calculator-page .rl-sidebar-card--popular .rl-sidebar-links{
        grid-template-columns:1fr 1fr !important;
        gap:5px !important;
    }
    .rl-calculator-page .rl-sidebar-card--popular .rl-sidebar-links li{
        padding:7px 8px !important;
        font-size:11px !important;
        line-height:1.18 !important;
    }

    /* FAQ + tips: compact support content */
    .rl-calculator-page .rl-page-faq{
        gap:5px !important;
    }
    .rl-calculator-page .rl-page-faq details{
        padding:8px 9px !important;
        border-radius:9px !important;
    }
    .rl-calculator-page .rl-page-faq summary{
        font-size:12px !important;
        line-height:1.25 !important;
    }
    .rl-calculator-page .rl-page-faq p{
        margin-top:6px !important;
        font-size:11px !important;
        line-height:1.35 !important;
    }
    .rl-calculator-page .rl-sidebar-card--tips{
        padding:11px !important;
    }
    .rl-calculator-page .rl-sidebar-card--tips h3{
        margin:0 0 5px !important;
        font-size:15px !important;
    }
    .rl-calculator-page .rl-sidebar-card--tips ul{
        margin:5px 0 0 !important;
        padding-left:16px !important;
    }
    .rl-calculator-page .rl-sidebar-card--tips li{
        margin-bottom:3px !important;
        font-size:11px !important;
        line-height:1.3 !important;
    }

    /* Footer can stay readable but should start sooner */
    .rl-calculator-page .site-footer,
    .rl-calculator-page footer.wp-block-template-part,
    .rl-calculator-page .wp-site-blocks > footer{
        margin-top:18px !important;
    }
}

@media(max-width:380px){
    .rl-calculator-page .rl-page-related-grid,
    .rl-calculator-page .rl-sidebar-card--popular .rl-sidebar-links{
        grid-template-columns:1fr !important;
    }
    .rl-calculator-page .rl-page-article{
        grid-template-columns:78px minmax(0,1fr) !important;
    }
    .rl-calculator-page .rl-page-article-thumb,
    .rl-calculator-page .rl-page-article img{
        width:78px !important;
        height:70px !important;
        min-height:70px !important;
    }
}

/* =========================================================
   Mobile Formula Compact v1.4.3
   Scope: ONLY the "Как мы рассчитали?" formula block on phones.
   No calculator logic, form fields, result cards or desktop styles touched.
   ========================================================= */
@media(max-width:640px){
    .rl-calculator-page .rl-formula-block{
        padding:9px !important;
    }

    .rl-calculator-page .rl-formula-block h2,
    .rl-calculator-page .rl-formula-head h2{
        margin:0 0 6px !important;
        font-size:16px !important;
        line-height:1.15 !important;
    }

    .rl-calculator-page .rl-formula-head p,
    .rl-calculator-page .rl-formula-block > p{
        margin:0 0 6px !important;
        font-size:10.5px !important;
        line-height:1.28 !important;
    }

    .rl-calculator-page .rl-formula-steps{
        gap:4px !important;
    }

    .rl-calculator-page .rl-formula-step{
        min-height:0 !important;
        padding:5px 7px !important;
        gap:6px !important;
        border-radius:9px !important;
    }

    .rl-calculator-page .rl-formula-number{
        flex:0 0 20px !important;
        width:20px !important;
        height:20px !important;
        font-size:9.5px !important;
        line-height:20px !important;
    }

    .rl-calculator-page .rl-formula-step h3,
    .rl-calculator-page .rl-formula-step h4,
    .rl-calculator-page .rl-formula-step strong{
        margin:0 0 1px !important;
        font-size:12px !important;
        line-height:1.15 !important;
    }

    .rl-calculator-page .rl-formula-step p{
        margin:0 !important;
        font-size:10.5px !important;
        line-height:1.25 !important;
    }
}


/* =========================================================
   Mobile Actions Compact v1.4.4
   Scope: ONLY the \"Что делать дальше?\" cards on phones.
   Keeps buttons comfortable to tap; no desktop or calculator logic changes.
   ========================================================= */
@media(max-width:640px){
    .rl-calculator-page .rl-next-steps{
        padding:10px !important;
    }

    .rl-calculator-page .rl-next-steps h2,
    .rl-calculator-page .rl-next-steps-head h2{
        margin:0 0 7px !important;
        font-size:16px !important;
        line-height:1.15 !important;
    }

    .rl-calculator-page .rl-next-steps-head p{
        margin:0 0 7px !important;
        font-size:10.5px !important;
        line-height:1.3 !important;
    }

    .rl-calculator-page .rl-next-steps-grid{
        gap:6px !important;
    }

    .rl-calculator-page .rl-step-card{
        min-height:0 !important;
        padding:9px 10px !important;
        border-radius:10px !important;
    }

    .rl-calculator-page .rl-step-icon{
        width:24px !important;
        height:24px !important;
        margin-bottom:5px !important;
        border-radius:7px !important;
    }

    .rl-calculator-page .rl-step-icon svg{
        width:13px !important;
        height:13px !important;
    }

    .rl-calculator-page .rl-step-card h3{
        margin:0 0 4px !important;
        font-size:13.5px !important;
        line-height:1.18 !important;
    }

    .rl-calculator-page .rl-step-card p{
        margin:0 0 7px !important;
        font-size:10.5px !important;
        line-height:1.3 !important;
    }

    .rl-calculator-page .rl-step-card button,
    .rl-calculator-page .rl-step-card .button,
    .rl-calculator-page .rl-step-card a.rl-step-button{
        min-height:36px !important;
        margin-top:0 !important;
        padding:8px 10px !important;
        font-size:11px !important;
        line-height:1.2 !important;
        border-radius:8px !important;
    }
}


/* =========================================================
   Mobile Lower Page Polish v1.4.5
   Scope: presentation only on phones.
   - denser article cards
   - 2-column useful-calculator navigation
   - slightly stronger tips typography
   - smaller footer logo
   No formulas, JS, fields, result calculations or desktop geometry touched.
   ========================================================= */
@media(max-width:640px){

    /* ARTICLES — keep branded images, but reduce vertical weight */
    .rl-calculator-page .rl-page-slot--articles .rl-page-card,
    .rl-calculator-page .rl-page-card:has(.rl-page-article-grid){
        padding:10px !important;
    }

    .rl-calculator-page .rl-page-article-grid{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:8px !important;
    }

    .rl-calculator-page .rl-page-article{
        padding:0 0 9px !important;
        min-height:0 !important;
        border-radius:10px !important;
        overflow:hidden !important;
    }

    /* Works whether the thumb is the image itself or a wrapper */
    .rl-calculator-page .rl-page-article-thumb{
        display:block !important;
        width:100% !important;
        height:112px !important;
        min-height:112px !important;
        margin:0 0 8px !important;
        border-radius:0 !important;
        overflow:hidden !important;
    }

    .rl-calculator-page .rl-page-article-thumb img,
    .rl-calculator-page .rl-page-article > img{
        width:100% !important;
        height:112px !important;
        min-height:112px !important;
        object-fit:cover !important;
        border-radius:0 !important;
    }

    .rl-calculator-page .rl-page-article .rl-page-kicker,
    .rl-calculator-page .rl-page-article h3,
    .rl-calculator-page .rl-page-article p,
    .rl-calculator-page .rl-page-article > a:not(.rl-page-article-thumb){
        margin-left:10px !important;
        margin-right:10px !important;
    }

    .rl-calculator-page .rl-page-article .rl-page-kicker{
        margin-bottom:3px !important;
        font-size:10px !important;
    }

    .rl-calculator-page .rl-page-article h3{
        margin-top:0 !important;
        margin-bottom:4px !important;
        font-size:14px !important;
        line-height:1.2 !important;
    }

    .rl-calculator-page .rl-page-article p{
        display:-webkit-box !important;
        -webkit-line-clamp:2 !important;
        -webkit-box-orient:vertical !important;
        overflow:hidden !important;
        margin-bottom:5px !important;
        font-size:11px !important;
        line-height:1.32 !important;
    }

    .rl-calculator-page .rl-page-article > a:not(.rl-page-article-thumb){
        display:inline-block !important;
        font-size:11.5px !important;
        line-height:1.25 !important;
    }

    /* USEFUL CALCULATORS — true 2 x 2 grid on 390–430 px */
    .rl-calculator-page .rl-page-card:has(.rl-page-related-grid){
        padding:10px !important;
    }

    .rl-calculator-page .rl-page-related-grid{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:7px !important;
    }

    .rl-calculator-page .rl-related-card{
        min-width:0 !important;
        min-height:64px !important;
        padding:9px !important;
        border-radius:9px !important;
        font-size:11.5px !important;
        line-height:1.22 !important;
    }

    .rl-calculator-page .rl-related-card p{
        margin:4px 0 0 !important;
        font-size:10.5px !important;
        line-height:1.28 !important;
    }

    /* TIPS — slightly stronger than v1.4.4, still compact */
    .rl-calculator-page .rl-sidebar-card--tips{
        padding:12px 13px !important;
    }

    .rl-calculator-page .rl-sidebar-card--tips h3{
        margin:0 0 6px !important;
        font-size:15.5px !important;
        line-height:1.2 !important;
    }

    .rl-calculator-page .rl-sidebar-card--tips ul{
        margin:5px 0 0 !important;
        padding-left:17px !important;
    }

    .rl-calculator-page .rl-sidebar-card--tips li{
        margin-bottom:4px !important;
        font-size:12px !important;
        line-height:1.35 !important;
    }

    /* FOOTER — keep brand visible without dominating the last screen */
    .rl-calculator-page .site-footer .wp-block-site-logo img,
    .rl-calculator-page footer.wp-block-template-part .wp-block-site-logo img,
    .rl-calculator-page .site-footer img.custom-logo,
    .rl-calculator-page footer.wp-block-template-part img.custom-logo{
        width:auto !important;
        max-width:180px !important;
        height:auto !important;
    }
}

@media(max-width:380px){
    .rl-calculator-page .rl-page-related-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }
    .rl-calculator-page .rl-related-card{
        min-height:58px !important;
        padding:8px !important;
        font-size:11px !important;
    }
    .rl-calculator-page .rl-page-article-thumb,
    .rl-calculator-page .rl-page-article-thumb img,
    .rl-calculator-page .rl-page-article > img{
        height:104px !important;
        min-height:104px !important;
    }
}

/* =========================================================
   Final Mobile Compact v1.4.6
   Scope: presentation only on calculator pages <= 640px.
   Purpose:
   - make the "Как мы рассчитали?" explanation denser;
   - make lower useful-calculator cards materially shorter;
   - preserve comfortable tap targets in action cards.
   No JS, formulas, inputs, result renderer or desktop geometry touched.
   ========================================================= */
@media(max-width:640px){

    /* HOW WE CALCULATED — final density pass */
    .rl-calculator-page .rl-formula-block{
        padding:8px !important;
    }

    .rl-calculator-page .rl-formula-block h2,
    .rl-calculator-page .rl-formula-head h2{
        margin:0 0 5px !important;
        font-size:15px !important;
        line-height:1.15 !important;
    }

    .rl-calculator-page .rl-formula-head p,
    .rl-calculator-page .rl-formula-block > p{
        margin:0 0 5px !important;
        font-size:10px !important;
        line-height:1.24 !important;
    }

    .rl-calculator-page .rl-formula-steps{
        gap:4px !important;
    }

    .rl-calculator-page .rl-formula-step{
        min-height:0 !important;
        padding:5px 6px !important;
        gap:5px !important;
        border-radius:8px !important;
    }

    .rl-calculator-page .rl-formula-number{
        flex:0 0 18px !important;
        width:18px !important;
        height:18px !important;
        font-size:9px !important;
        line-height:18px !important;
    }

    .rl-calculator-page .rl-formula-step h3,
    .rl-calculator-page .rl-formula-step h4,
    .rl-calculator-page .rl-formula-step strong{
        margin:0 0 1px !important;
        font-size:11.5px !important;
        line-height:1.15 !important;
    }

    .rl-calculator-page .rl-formula-step p{
        margin:0 !important;
        font-size:9.75px !important;
        line-height:1.22 !important;
    }

    /* USEFUL CALCULATORS — compact 2-column cards */
    .rl-calculator-page .rl-page-card:has(.rl-page-related-grid){
        padding:9px !important;
    }

    .rl-calculator-page .rl-page-card:has(.rl-page-related-grid) > h2,
    .rl-calculator-page .rl-page-card:has(.rl-page-related-grid) > h3{
        margin:0 0 7px !important;
        font-size:15px !important;
        line-height:1.15 !important;
    }

    .rl-calculator-page .rl-page-related-grid{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:6px !important;
        align-items:stretch !important;
    }

    .rl-calculator-page .rl-page-related-grid > *,
    .rl-calculator-page .rl-related-card{
        grid-column:auto !important;
        width:auto !important;
        min-width:0 !important;
        min-height:0 !important;
        margin:0 !important;
        padding:8px !important;
        border-radius:8px !important;
        font-size:11px !important;
        line-height:1.2 !important;
    }

    .rl-calculator-page .rl-related-card h3,
    .rl-calculator-page .rl-related-card h4,
    .rl-calculator-page .rl-related-card strong{
        margin:0 0 4px !important;
        font-size:12px !important;
        line-height:1.18 !important;
    }

    .rl-calculator-page .rl-related-card p{
        display:-webkit-box !important;
        -webkit-line-clamp:2 !important;
        -webkit-box-orient:vertical !important;
        overflow:hidden !important;
        margin:3px 0 4px !important;
        font-size:9.75px !important;
        line-height:1.25 !important;
    }

    .rl-calculator-page .rl-related-card a{
        font-size:10.5px !important;
        line-height:1.2 !important;
    }
}

@media(max-width:380px){
    .rl-calculator-page .rl-page-related-grid{
        gap:5px !important;
    }

    .rl-calculator-page .rl-page-related-grid > *,
    .rl-calculator-page .rl-related-card{
        padding:7px !important;
    }

    .rl-calculator-page .rl-related-card h3,
    .rl-calculator-page .rl-related-card h4,
    .rl-calculator-page .rl-related-card strong{
        font-size:11.5px !important;
    }
}


/* =========================================================
   v1.4.7 — calculator page inside shared RaschetLab Site Shell
   Header/footer styling comes from Content Hub Engine.
   Calculator content geometry remains owned here.
   ========================================================= */
.rl-calculator-page .rl-calculator-template{
    width:100%;
    margin:0;
    padding:0 0 6px;
    background:#f7f9fb;
}
.rl-calculator-page .rl-calculator-template-article{
    margin:0;
    padding:0;
}
.rl-calculator-page .rl-calculator-template-title{
    width:min(1180px,calc(100vw - 40px));
    margin:0 auto;
    padding:24px 0 0;
}
.rl-calculator-page .rl-calculator-template-title .entry-title{
    width:auto !important;
    margin:0 0 12px !important;
}
.rl-calculator-page .rl-calculator-template .entry-content{
    margin-top:0 !important;
    padding-top:0 !important;
}
.rl-calculator-page .rl-site-footer{
    margin-top:24px;
}
@media(max-width:640px){
    .rl-calculator-page .rl-calculator-template-title{
        width:min(100% - 20px,1180px);
        padding-top:18px;
    }
    .rl-calculator-page .rl-calculator-template-title .entry-title{
        font-size:29px !important;
        line-height:1.1 !important;
    }
}
