body { font-family: Metropolis, system-ui, -apple-system, "Segoe UI", sans-serif;
               margin: 0; background: #f6f8fb; color: #26332a; padding-bottom: calc(145px + env(safe-area-inset-bottom)); }
        header { background: rgba(255,255,255,.96); color: #26332a; padding: 12px 16px;
                 position: sticky; top: 0; z-index: 10;
                 display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e5ebf0;
                 backdrop-filter: blur(12px); }
        header a.back { color: #1769aa; text-decoration: none; font-size: 20px;
                        padding: 4px 10px; border-radius: 10px; background: #eaf3fb; }
        header a.back:hover { background: #d2e4f5; }
        header h1 { margin: 0; color: #26392a; font-size: 18px; font-weight: 750; flex: 1; }

        main { padding: 18px 12px 0; max-width: 760px; margin: 0 auto; }

        .card { background: #fff; border: 1px solid #e6edf2; border-radius: 19px; padding: 18px;
                box-shadow: 0 5px 18px rgba(31,58,80,.045); margin-bottom: 14px; }
        .card h2 { margin: 0 0 14px; color: #303b32; font-size: 17px; font-weight: 750; }

        /* --- Список товаров --- */
        .item { display: grid; grid-template-columns: 1fr auto auto;
                gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0;
                align-items: center; font-size: 14px; }
        .item:last-child { border-bottom: 0; }
        .item-name  { line-height: 1.3; }
        .item-qty   { color: #777; white-space: nowrap; font-size: 13px; }
        .item-sum   { font-weight: 700; color: #145b95; white-space: nowrap; }

        /* --- Итоги --- */
        .totals { margin-top: 10px; padding-top: 10px; border-top: 2px dashed #eee; }
        .row { display: flex; justify-content: space-between; font-size: 14px;
               padding: 4px 0; }
        .row.total { font-size: 18px; font-weight: 700; margin-top: 6px;
                     padding-top: 8px; border-top: 1px solid #eee; }
        .row .free { color: #145b95; font-weight: 700; }
        .hint { color: #888; font-size: 12px; margin-top: 4px; }

        /* --- Форма --- */
        label { display: block; font-size: 13px; color: #444;
                margin: 10px 0 4px; font-weight: 600; }
        input[type=text], input[type=tel], textarea {
            width: 100%; box-sizing: border-box; padding: 10px 12px;
            border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
            font-family: inherit;
        }
        input[type=text]:focus, input[type=tel]:focus, textarea:focus {
            outline: none; border-color: #247fbd;
            box-shadow: 0 0 0 3px rgba(35,124,189,.15);
        }
        textarea { min-height: 60px; resize: vertical; }
        .address-first-form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
        .address-first-form .row > div { min-width: 0; }

        /* --- Радиокнопки оплаты --- */
        .pay-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
        .pay-options label { display: flex; align-items: center; gap: 8px;
            min-width: 0; padding: 12px 11px; margin: 0;
            border: 1px solid #e7ece4; border-radius: 13px; cursor: pointer;
            font-size: 12px; font-weight: 650; color: #3a463b; background: #f9fbfd;
            transition: border-color .15s, background .15s; }
        .pay-options label:hover { background: #f1f7fc; }
        .pay-options input { margin: 0; }
        .pay-options input:checked + span { color: #145b95; }
        .pay-options label.checked { border-color: #6b9fca; background: #f1f7fc; }

        .address-button {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            /* width: 100%; */
            padding: 13px 14px;
            border: 1px solid #d6e5f2;
            border-radius: 13px;
            background: #f6f8fb;
            color: #334334;
            text-align: left;
            cursor: pointer;
            text-decoration: none;
            }
        .address-button:hover { background: #eff5fc; color: #1769aa; }
        .address-button span { overflow-wrap: anywhere; }
        .address-button strong { flex: 0 0 auto; color: #1769aa; font-size: 12px; }

        /* --- Кнопка --- */
        .submit { width: 100%; padding: 14px; border: none; border-radius: 13px;
                  background: #1769aa; color: #fff; font-size: 15px; font-weight: 750;
                  cursor: pointer; margin-top: 16px; margin-bottom: 12px; }
        .submit:hover { background: #145c94; }
        .submit:disabled { background: #bbb; cursor: not-allowed; }

        /* --- Сообщения --- */
        .msg-ok    { background: #e9f2fa; border: 1px solid #b9d6f0;
                     color: #0f4c81; padding: 20px; border-radius: 10px;
                     text-align: center; font-size: 15px; }
        .msg-ok b { font-size: 20px; display: block; margin-bottom: 8px; }
        .msg-err   { background: #ffebee; border: 1px solid #ef9a9a;
                     color: #b71c1c; padding: 12px 14px; border-radius: 8px;
                     margin-bottom: 12px; font-size: 14px; }
        .empty-cart { text-align: center; padding: 30px 10px; color: #666; }
        @media (max-width: 390px) {
            .pay-options { gap: 6px; }
            .pay-options label { padding: 10px 8px; font-size: 11px; }
            .card { padding: 15px; }
        }
/* Styles formerly written directly in checkout markup */
.address-updated { color: #1769aa; }
.checkout-order-number { display: inline; font-size: 16px; }
.checkout-order-status { margin-top: 10px; }
.checkout-order-status b { display: inline; font-size: 15px; }
.checkout-success-links { margin-top: 16px; }
.checkout-success-links a { color: #0f4c81; text-decoration: underline; }
.checkout-catalog-link { color: #145b95; font-weight: 600; }
