@media screen and (max-width: 1199px) {
    #proposal-root {
        display: block;
        width: 100%;
        min-width: 0;
        padding: 12px 0 24px;
    }

    #proposal-root, #proposal-root * {
        box-sizing: border-box;
    }

    #proposal-root .offer-page {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
    }

    #proposal-root .brand-bar {
        min-height: 0;
        padding: 24px;
    }

    #proposal-root .page-body {
        padding: 24px;
    }

    #proposal-root .intro-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 20px;
    }

    #proposal-root .intro-grid > *, #proposal-root .bottom-grid > *,
    #proposal-root .summary-row > * {
        min-width: 0;
    }

    #proposal-root h1 {
        font-size: 24px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    #proposal-root .lead {
        font-size: 14px;
        line-height: 1.5;
    }

    #proposal-root .offer-meta {
        font-size: 15px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    #proposal-root .qr-visual {
        width: 100px;
        height: 100px;
    }

    #proposal-root .table-wrap {
        min-width: 0;
        padding-top: 20px;
    }

    #proposal-root .section-note {
        font-size: 13px;
        line-height: 1.4;
    }

    #proposal-root .table-wrap table {
        display: block;
        width: 100%;
        min-width: 0;
        border: 0;
    }

    #proposal-root .table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    #proposal-root .table-wrap tbody {
        display: grid;
        gap: 16px;
        width: 100%;
    }

    #proposal-root .table-wrap tbody tr {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 0 16px;
        min-width: 0;
        padding: 16px;
        border: 1px solid var(--line, #dedbd7);
        background: #fff;
    }

    #proposal-root .table-wrap tbody td {
        display: block;
        width: auto;
        min-width: 0;
        max-width: 100%;
        padding: 0;
        border: 0;
        font-size: 16px;
        line-height: 1.5;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #proposal-root .table-wrap tbody td:first-child {
        grid-column: 1 / -1;
        margin-bottom: 12px;
        font-size: 13px;
        color: #77736f;
    }

    #proposal-root .table-wrap tbody td:first-child::before {
        content: 'Позиция №';
    }

    #proposal-root .table-wrap tbody td:nth-child(2) {
        grid-column: 1;
    }

    #proposal-root .table-wrap tbody td:nth-child(3) {
        grid-column: 2;
        padding-bottom: 12px;
    }

    #proposal-root .product-thumb {
        width: 100%;
        max-width: 100px;
        height: 130px;
        margin: 0 auto;
    }

    #proposal-root .product-thumb img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    #proposal-root .product-name {
        font-size: 17px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    #proposal-root .product-meta {
        margin-top: 8px;
        font-size: 14px;
        line-height: 1.5;
    }

    #proposal-root .product-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        max-width: 100%;
        font-size: 14px;
        line-height: 1.4;
        word-break: normal;
    }

    #proposal-root .table-wrap tbody td:nth-child(n+4) {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: baseline;
        gap: 4px 12px;
        padding: 10px 0;
        border-top: 1px solid var(--line, #dedbd7);
        text-align: right;
        word-break: normal;
    }

    #proposal-root .table-wrap tbody td:nth-child(n+4)::before {
        flex: 1 1 105px;
        color: #77736f;
        font-size: 14px;
        font-weight: 400;
        text-align: left;
    }

    #proposal-root .table-wrap tbody td:nth-child(4)::before {
        content: 'Цена';
    }

    #proposal-root .table-wrap tbody td:nth-child(5)::before {
        content: 'Скидка';
    }

    #proposal-root .table-wrap tbody td:nth-child(6)::before {
        content: 'Цена со скидкой';
    }

    #proposal-root .table-wrap tbody td:nth-child(7)::before {
        content: 'Количество';
    }

    #proposal-root .table-wrap tbody td:nth-child(8)::before {
        content: 'Сумма';
        color: #0a0a0a;
        font-weight: 700;
    }

    #proposal-root .table-wrap tbody td:nth-child(8) {
        padding-bottom: 0;
        font-size: 18px;
        font-weight: 700;
    }

    #proposal-root .summary-row, #proposal-root .bottom-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding-top: 20px;
    }

    #proposal-root .totals {
        grid-row: 1;
        width: 100%;
    }

    #proposal-root .totals-line {
        flex-wrap: wrap;
        align-items: baseline;
        padding: 12px;
        font-size: 15px;
        line-height: 1.4;
    }

    #proposal-root .totals-line span {
        flex: 1 1 120px;
    }

    #proposal-root .totals-line strong {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: right;
    }

    #proposal-root .totals-line.grand-total {
        padding: 16px 12px;
        font-size: 18px;
    }

    #proposal-root .totals-line.grand-total strong {
        font-size: 20px;
        line-height: 1.3;
    }

    #proposal-root .summary-note {
        padding: 12px;
        font-size: 14px;
        line-height: 1.5;
    }

    #proposal-root .box-title {
        padding: 14px 12px;
        font-size: 16px;
        line-height: 1.3;
    }

    #proposal-root .contacts {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    }

    #proposal-root .contacts dt, #proposal-root .contacts dd {
        min-width: 0;
        padding: 10px 12px;
        font-size: 14px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    #proposal-root .conditions {
        padding: 14px 16px 14px 30px;
        font-size: 14px;
        line-height: 1.55;
    }

    #proposal-root .page-footer {
        flex-wrap: wrap;
        font-size: 12px;
        padding-top: 20px;
    }
}

@media screen and (max-width: 767px) {
    #proposal-root .brand-bar {
        padding: 22px 16px;
    }

    #proposal-root .page-body {
        padding: 16px;
    }

    #proposal-root h1 {
        font-size: 21px;
    }

    #proposal-root .intro-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    #proposal-root .offer-meta {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    #proposal-root .qr-card {
        justify-content: flex-start;
    }

    #proposal-root .table-wrap tbody tr {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 0 12px;
        padding: 12px;
    }

    #proposal-root .product-thumb {
        height: 110px;
    }

    #proposal-root .product-name {
        font-size: 16px;
    }

    #proposal-root .contacts {
        grid-template-columns: minmax(0, 1fr);
    }

    #proposal-root .contacts dt {
        padding: 10px 12px 2px;
        border-bottom: 0;
        background: transparent;
        font-size: 12px;
    }

    #proposal-root .contacts dd {
        padding: 2px 12px 10px;
    }
}

@media screen and (max-width: 359px) {
    #proposal-root .page-body {
        padding: 12px;
    }

    #proposal-root .table-wrap tbody tr {
        grid-template-columns: minmax(0, 1fr);
    }

    #proposal-root .table-wrap tbody td:nth-child(2),
    #proposal-root .table-wrap tbody td:nth-child(3) {
        grid-column: 1;
    }

    #proposal-root .product-thumb {
        max-width: 120px;
        height: 140px;
        margin-bottom: 12px;
    }
}