.mansard-roof-page {
    min-height: 70vh;
    padding: 32px 0 80px;
    color: #14231e;
    background: #f6f8f7;
}

.mansard-roof-page .roof-shell {
    max-width: 1120px;
}

.mansard-dynamic,
.mansard-table,
.mansard-actions {
    box-sizing: border-box;
    margin-top: 24px;
    padding: clamp(24px, 4vw, 46px);
    border: 1px solid #d6e6de;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(20, 68, 50, .06);
}

.mansard-dynamic__head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.mansard-dynamic__head h2,
.mansard-table h2,
.mansard-actions h2 {
    margin: 0;
    color: #102820;
    font-size: clamp(1.45rem, 2vw, 2rem);
}

.mansard-dynamic__head > p {
    max-width: 410px;
    margin: 0;
    color: #61746d;
}

.mansard-dynamic__canvas {
    margin-top: 26px;
    overflow: hidden;
    border: 1px solid #d5e6dc;
    border-radius: 18px;
    background: #fbfdfc;
}

.mansard-dynamic__canvas svg {
    display: block;
    width: 100%;
    height: auto;
}

.mansard-dynamic__caption {
    margin: 19px 0 0;
    color: #61746d;
}

.mansard-table__scroll {
    margin-top: 22px;
    overflow-x: auto;
}

.mansard-table table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
}

.mansard-table th,
.mansard-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e0ece5;
    text-align: left;
}

.mansard-table th {
    color: #61746d;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mansard-table td:not(:first-child) {
    color: #102820;
    font-weight: 700;
}

.mansard-actions {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(420px, 1.2fr);
    gap: 34px;
    background: #102820;
}

.mansard-actions h2,
.mansard-actions p {
    color: #fff;
}

.mansard-actions .roof-eyebrow,
.mansard-actions__notice {
    color: #9ee6c8;
}

.mansard-actions__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
}

.mansard-actions button,
.mansard-actions select {
    min-height: 50px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 13px;
    padding: 10px 14px;
    color: #fff;
    background: rgba(255,255,255,.08);
    font: inherit;
    font-weight: 750;
}

.mansard-actions select {
    color: #102820;
    background: #fff;
}

.mansard-actions button:first-child {
    border-color: #1eb77d;
    background: #0d9566;
}

.mansard-actions__notice {
    grid-column: 1 / -1;
    min-height: 1.4em;
    margin: -18px 0 0;
}

.mansard-content {
    margin-top: 48px;
}

@media (max-width: 860px) {
    .mansard-actions { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .mansard-dynamic__head { display: block; }
    .mansard-dynamic__head > p { margin-top: 14px; }
    .mansard-actions__buttons { grid-template-columns: 1fr; }
    .mansard-actions__notice { margin-top: 0; }
}

.roof-shell {
    /* Соответствует центральной колонке col-xl-10 у «Ленточного фундамента». */
    max-width: 960px;
    margin: auto;
}

.roof-hero {
    max-width: 760px;
    margin-bottom: 36px;
}

.roof-eyebrow {
    margin: 0 0 8px;
    color: #08724e;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.roof-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.06;
    letter-spacing: -0.045em;
}

.roof-hero p {
    margin: 0;
    color: #56675f;
    font-size: 1.1rem;
}

.roof-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 24px;
    align-items: start;
}

.roof-card {
    padding: 28px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce6e0;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgb(16 40 32 / 7%);
}

.roof-form-section + .roof-form-section {
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid #dce6e0;
}

.roof-card h2 {
    margin: 0 0 20px;
    font-size: 1.25rem;
}

.roof-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.roof-field label {
    display: block;
    margin: 0 0 7px;
    color: #31423a;
    font-size: 0.9rem;
    font-weight: 700;
}

.roof-field input,
.roof-field select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    color: #14231e;
    font: inherit;
    font-variant-numeric: tabular-nums;
    background: #fff;
    border: 1px solid #b8c9c0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgb(16 40 32 / 4%);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.roof-field input:hover,
.roof-field select:hover {
    border-color: #7e9b8d;
}

.roof-field input:focus,
.roof-field select:focus {
    border-color: #14805c;
    outline: 0;
    box-shadow: 0 0 0 4px rgb(20 128 92 / 15%);
}

.roof-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 22px;
    margin-top: 28px;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, #19a874, #08724e);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgb(8 114 78 / 25%);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.roof-submit:hover,
.roof-submit:focus {
    color: #fff;
    box-shadow: 0 11px 24px rgb(8 114 78 / 31%);
    transform: translateY(-1px);
}

.roof-submit:active {
    transform: translateY(0);
}

.roof-result {
    position: sticky;
    top: 16px;
}

.roof-result dl {
    margin: 0;
}

.roof-result dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5ebe7;
}

.roof-result dt {
    color: #61706a;
}

.roof-result dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.roof-total dt,
.roof-total dd {
    color: #08724e;
    font-weight: 800;
}

.roof-result > p {
    margin: 18px 0 0;
    color: #61706a;
    font-size: 0.85rem;
}

.roof-content {
    max-width: 820px;
    padding-top: 64px;
}

.roof-content h2 {
    margin: 0 0 16px;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.roof-content-intro > p:last-child {
    color: #52635b;
    font-size: 1.05rem;
}

.roof-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 28px 0 48px;
}

.roof-benefits article {
    padding: 20px;
    background: #fff;
    border: 1px solid #dce6e0;
    border-radius: 14px;
}

.roof-benefits h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.roof-benefits p {
    margin: 0;
    color: #61706a;
}

.roof-section {
    max-width: 820px;
    padding: 28px 0;
    border-top: 1px solid #dce6e0;
}

.roof-section ol {
    padding-left: 22px;
    margin: 0;
}

.roof-section li + li {
    margin-top: 10px;
}

.roof-warning {
    padding: 24px;
    margin: 10px 0 28px;
    background: #fff4d9;
    border: 1px solid #f1dcaa;
    border-radius: 14px;
}

.roof-warning h2,
.roof-warning p {
    margin-bottom: 0;
}

.roof-diagrams {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 0 0 28px;
}

.roof-diagram {
    padding: 14px;
    margin: 0;
    background: #fff;
    border: 1px solid #dce6e0;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgb(16 40 32 / 5%);
}

.roof-diagram img {
    display: block;
    width: 100%;
    height: auto;
    background: #f8fbf9;
    border: 1px solid #e1e9e4;
    border-radius: 10px;
}

.roof-diagram figcaption {
    padding: 13px 4px 2px;
    color: #61706a;
    font-size: 0.88rem;
    line-height: 1.45;
}

@media (max-width: 991px) {
    .roof-layout {
        grid-template-columns: 1fr;
    }

    .roof-result {
        position: static;
    }
}

@media (max-width: 767px) {
    .mansard-roof-page {
        padding: 24px 0 56px;
    }

    .roof-card {
        padding: 20px;
    }

    .roof-fields,
    .roof-benefits,
    .roof-diagrams {
        grid-template-columns: 1fr;
    }

    .roof-diagrams {
        gap: 14px;
    }

    .roof-diagram {
        padding: 10px;
    }

    .roof-submit {
        width: 100%;
    }

    .roof-content {
        padding-top: 44px;
    }
}

/* Единый блок действий: эталон — калькулятор деревянной фермы. */
.roof-shell {
    max-width: 1120px;
}

.mansard-actions {
    display: grid;
    grid-template-columns: minmax(0, .75fr) minmax(430px, 1.25fr);
    gap: 36px;
    padding: clamp(24px, 4vw, 46px);
    background: #102820;
    border: 1px solid #d6e6de;
    border-radius: 24px;
    box-shadow: 0 18px 36px rgb(20 68 50 / 6%);
}

.mansard-actions h2,
.mansard-actions p {
    color: #fff;
}

.mansard-kicker {
    margin: 0 0 8px;
    color: #69d5ab;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mansard-actions > div > p:not(.mansard-kicker) {
    color: #c9ddd4;
}

.mansard-actions__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
}

.mansard-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 12px;
    color: #fff;
    background: rgb(255 255 255 / 8%);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mansard-action:hover {
    border-color: rgb(255 255 255 / 50%);
    background: rgb(255 255 255 / 16%);
    transform: translateY(-1px);
}

.mansard-action--primary {
    border-color: #1eb77d;
    background: #0d9566;
}

.mansard-action--primary:hover {
    border-color: #46d69e;
    background: #0aa06d;
}

.mansard-export {
    display: grid;
    grid-column: 1 / -1;
    gap: 7px;
}

.mansard-export label {
    color: #dceee6;
    font-size: .9rem;
    font-weight: 700;
}

.mansard-export > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.mansard-export select {
    width: 100%;
    min-height: 50px;
    padding: 0 13px;
    border-color: transparent;
    border-radius: 12px;
    color: #102820;
    background: #fff;
    font: inherit;
}

.mansard-actions__status {
    grid-column: 1 / -1;
    min-height: 1.4em;
    margin: -18px 0 0;
    color: #9ee6c8 !important;
    font-size: .9rem;
}

@media (max-width: 860px) {
    .mansard-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .mansard-actions {
        padding: 20px;
    }

    .mansard-actions__buttons,
    .mansard-export > div {
        grid-template-columns: 1fr;
    }

    .mansard-actions__status {
        margin-top: 0;
    }
}

/* Защита от внешних стилей шаблона: схемы всегда две в ряд на десктопе. */
.mansard-roof-page .roof-diagrams {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px;
}

.mansard-roof-page .roof-diagram {
    min-width: 0;
}

@media (max-width: 767px) {
    .mansard-roof-page .roof-diagrams {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
}
