        :root {
            --brand-dark: #314355;
            --brand: #39526b;
            --brand-light: #4a6a8a;
            --brand-pale: #e8edf3;
            --accent: #e67e22;
            --bg: #f0f2f5;
            --card-bg: #ffffff;
            --border: #d0d7e0;
            --text: #2c3e50;
            --text-light: #6b7d8e;
            --white: #ffffff;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: var(--bg); color: var(--text);
            min-height: 100vh; padding: 20px;
        }

        .calculator { max-width: 860px; margin: 0 auto; }

        .calculator__header {
            background: linear-gradient(135deg, var(--brand-dark), var(--brand));
            border-radius: 14px 14px 0 0; padding: 32px 28px 26px;
            text-align: center; color: var(--white);
        }
        .calculator__header h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
        .calculator__header p { font-size: 12px; opacity: .75; }
		.calculator__header p a { color: var(--white) }

        .mode-toggle {
            display: flex; background: var(--card-bg);
            border-left: 1px solid var(--border); border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
        }
        .mode-toggle__btn { flex: 1; position: relative; cursor: pointer; display: block; }
        .mode-toggle__btn input { position: absolute; opacity: 0; width: 0; height: 0; }
        .mode-toggle__label {
            display: block; text-align: center; padding: 14px 16px;
            font-weight: 600; font-size: 14px; color: var(--text-light);
            border-bottom: 3px solid transparent; transition: all .2s;
        }
        .mode-toggle__label:hover { color: var(--brand); background: #f5f7fa; }
        .mode-toggle__btn input:checked + .mode-toggle__label {
            color: var(--brand); border-bottom-color: var(--accent); background: var(--brand-pale);
        }

        .calc-section {
            background: var(--card-bg);
            border-left: 1px solid var(--border); border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border); padding: 26px 28px; scroll-margin-top: 12px;
        }
        .calc-section__title {
            display: flex; align-items: center; font-size: 16px;
            font-weight: 600; margin-bottom: 18px; color: var(--brand-dark);
        }
        .calc-section__step {
            display: inline-flex; align-items: center; justify-content: center;
            width: 28px; height: 28px; border-radius: 50%;
            background: var(--brand); color: var(--white);
            font-weight: 700; font-size: 13px; margin-right: 10px; flex-shrink: 0;
        }

        .option-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px;
        }
        .option-grid--lengths { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }

        .option-card { position: relative; cursor: pointer; display: block; }
        .option-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
        .option-card__body {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            padding: 14px 10px; border: 2px solid var(--border); border-radius: 10px;
            text-align: center; transition: all .15s; min-height: 56px; background: var(--white);
        }
        .option-card__body:hover { border-color: var(--brand-light); }
        .option-card input:checked + .option-card__body {
            border-color: var(--brand); background: var(--brand-pale);
            box-shadow: 0 0 0 3px rgba(57, 82, 107, .18);
        }
        .option-card__body--none { border-style: dashed; background: #fafbfc; }
        .option-card__photo {
            width: 100%; max-width: 140px; height: 80px;
            object-fit: contain; margin-bottom: 8px; border-radius: 4px;
        }
        .option-card__icon { margin-bottom: 8px; line-height: 0; }
        .option-card__name { font-weight: 700; font-size: 14px; margin-bottom: 2px; color: var(--brand-dark); }
        .option-card__detail { font-size: 12px; color: var(--text-light); line-height: 1.45; }

        /* ======== Превью изделия ======== */
        .preview {
            background: var(--card-bg);
            border-left: 1px solid var(--border); border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border); padding: 26px 28px; scroll-margin-top: 12px;
        }
        .preview__title {
            font-size: 14px; font-weight: 600; color: var(--text-light);
            text-align: center; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px;
        }
        .preview__assembly {
            display: flex; align-items: center; justify-content: center;
            gap: 0; padding: 10px 0 35px; min-height: 140px;
        }
        .preview__pike {
            width: 90px; height: 90px;
            display: flex; align-items: center; flex-shrink: 0;
        }
        .preview__pike--a { justify-content: flex-end; }
        .preview__pike--b { justify-content: flex-start; }
        .preview__pike img {
            display: block; width: 80px; height: 80px; object-fit: contain;
        }
        .preview__pike--a img { transform: rotate(-90deg); }
        .preview__pike--b img { transform: rotate(90deg); }
        .preview__pike-empty {
            width: 80px; height: 80px; border: 2px dashed #ccd3dc; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
        }
        .preview__pike--a .preview__pike-empty { border-right-style: solid; border-radius: 50% 0 0 50%; }
        .preview__pike--b .preview__pike-empty { border-left-style: solid; border-radius: 0 50% 50% 0; }
        .preview__pike-empty span { font-size: 11px; color: #aab4c0; }
        .preview__cable { flex: 1; max-width: 340px; min-width: 80px; position: relative; }
        .preview__cable-wire {
            width: 100%; height: 5px; border-radius: 2.5px;
            position: relative; overflow: hidden;
        }
        .preview__cable-wire::before {
            content: ''; position: absolute; inset: 0;
            background: repeating-linear-gradient(115deg,
                var(--brand) 0px, var(--brand) 3px,
                var(--brand-light) 3px, var(--brand-light) 6px);
            border-radius: 2.5px;
        }
        .preview__cable-label {
            position: absolute; top: 12px; left: 0; right: 0;
            font-size: 11px; color: var(--text-light); text-align: center; white-space: nowrap;
        }
        .preview__cable-label b { color: var(--brand-dark); font-weight: 700; }
        .preview__labels { display: flex; justify-content: center; gap: 0; margin-top: 8px; }
        .preview__label { width: 90px; text-align: center; flex-shrink: 0; }
        .preview__label-cable { flex: 1; max-width: 340px; min-width: 80px; }
        .preview__label-id { font-size: 12px; font-weight: 700; color: var(--brand-dark); }
        .preview__label-type { font-size: 10px; color: var(--text-light); line-height: 1.3; }

        /* ======== Кнопка лупы ======== */
        .preview__zoom-btn {
            display: inline-flex; align-items: center; justify-content: center;
            width: 20px; height: 20px; border: none; border-radius: 50%;
            background: var(--brand-pale); color: var(--brand);
            cursor: pointer; vertical-align: middle; margin-left: 3px;
            transition: all .15s; padding: 0; line-height: 0;
        }
        .preview__zoom-btn:hover {
            background: var(--brand); color: var(--white);
            transform: scale(1.15);
        }
        .preview__zoom-btn svg { width: 12px; height: 12px; }

        /* ======== Лайтбокс ======== */
        .lightbox {
            position: fixed; inset: 0; z-index: 10000;
            display: none; align-items: center; justify-content: center;
        }
        .lightbox--open { display: flex; }
        .lightbox__overlay {
            position: absolute; inset: 0;
            background: rgba(0, 0, 0, .7);
            cursor: pointer;
        }
        .lightbox__content {
            position: relative; z-index: 1;
            background: var(--white); border-radius: 14px;
            padding: 24px; max-width: 500px; width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
            animation: lightboxIn .25s ease;
        }
        @keyframes lightboxIn {
            from { opacity: 0; transform: scale(.9); }
            to { opacity: 1; transform: scale(1); }
        }
        .lightbox__close {
            position: absolute; top: 12px; right: 12px;
            width: 32px; height: 32px; border: none; border-radius: 50%;
            background: var(--brand-pale); color: var(--brand-dark);
            font-size: 18px; cursor: pointer; display: flex;
            align-items: center; justify-content: center;
            transition: all .15s;
        }
        .lightbox__close:hover { background: var(--brand); color: var(--white); }
        .lightbox__image {
            display: block; width: 100%; max-height: 350px;
            object-fit: contain; border-radius: 8px;
            background: #f8f9fb; padding: 16px;
        }
        .lightbox__caption {
            text-align: center; margin-top: 14px;
        }
        .lightbox__caption-id {
            font-size: 18px; font-weight: 700; color: var(--brand-dark);
        }
        .lightbox__caption-detail {
            font-size: 13px; color: var(--text-light); margin-top: 4px; line-height: 1.5;
        }

        /* ======== Поле количества ======== */
        .qty-wrap { display: flex; align-items: center; gap: 16px; }
        .qty-input {
            width: 120px; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px;
            font-size: 20px; font-weight: 700; font-family: inherit; text-align: center;
            color: var(--brand-dark); outline: none; transition: border-color .2s;
            -moz-appearance: textfield;
        }
        .qty-input::-webkit-outer-spin-button,
        .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .qty-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(57, 82, 107, .18); }
        .qty-btn {
            width: 40px; height: 40px; border: 2px solid var(--border); border-radius: 10px;
            background: var(--white); color: var(--brand); font-size: 20px; font-weight: 700;
            cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
            transition: all .15s; user-select: none;
        }
        .qty-btn:hover { border-color: var(--brand); background: var(--brand-pale); }
        .qty-btn:active { transform: scale(.95); }
        .qty-hint { font-size: 12px; color: var(--text-light); margin-top: 8px; }

        /* ======== Итоговый блок ======== */
        .result-bar {
            background: linear-gradient(135deg, var(--brand-dark), var(--brand));
            padding: 26px 32px; color: var(--white);
            display: flex; flex-wrap: wrap; align-items: center;
            justify-content: space-between; gap: 16px; scroll-margin-top: 12px;
        }
        .result-bar__summary { font-size: 14px; line-height: 1.9; opacity: .8; }
        .result-bar__total { text-align: right; }
        .result-bar__total-label {
            font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; opacity: .6; margin-bottom: 4px;
        }
        .result-bar__total-value { font-size: 38px; font-weight: 800; color: var(--accent); line-height: 1; }
        .result-bar__total-value small { font-size: 20px; font-weight: 600; }
        .result-bar__unit { font-size: 13px; opacity: .6; margin-top: 6px; }

        /* ======== Панель действий ======== */
        .actions-bar {
            background: var(--brand-dark); padding: 16px 32px;
            display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
        }
        .action-btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 10px 20px; background: rgba(255,255,255,.12);
            color: var(--white); border: 1px solid rgba(255,255,255,.2);
            border-radius: 8px; font-size: 13px; font-weight: 600; font-family: inherit;
            cursor: pointer; transition: all .15s; white-space: nowrap;
        }
        .action-btn:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.4); }
        .action-btn:active { transform: scale(.97); }
        .action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

        .order-check {
            display: flex; align-items: center; gap: 8px; cursor: pointer;
            color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; user-select: none;
        }
        .order-check input[type="checkbox"] {
            width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
        }

        .order-section {
            background: var(--card-bg);
            border-left: 1px solid var(--border); border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            overflow: hidden; max-height: 0; opacity: 0;
            transition: max-height .5s ease, opacity .4s ease, padding .5s ease;
            padding: 0 28px;
        }
        .order-section--open { max-height: 2000px; opacity: 1; padding: 26px 28px; }
        .order-section__title {
            font-size: 16px; font-weight: 600; color: var(--brand-dark);
            margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
        }
        .order-section__title svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
        .order-section iframe { width: 100%; max-width: 650px; border: none; display: block; margin: 0 auto; }

        .calc-footer { background: var(--brand-dark); border-radius: 0 0 14px 14px; height: 6px; }

        .toast {
            position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
            background: var(--brand-dark); color: var(--white);
            padding: 12px 24px; border-radius: 10px; font-size: 14px; font-weight: 600;
            box-shadow: 0 6px 24px rgba(0,0,0,.25);
            opacity: 0; transition: all .3s ease; z-index: 9999; pointer-events: none;
        }
        .toast--visible { transform: translateX(-50%) translateY(0); opacity: 1; }

        .print-sheet { display: none; }

        /* ======== Адаптив ======== */
        @media (max-width: 600px) {
            body { padding: 10px; }
            .calculator__header { padding: 22px 18px 18px; border-radius: 12px 12px 0 0; }
            .calc-section { padding: 18px 14px; }
            .preview { padding: 18px 14px; }
            .mode-toggle__label { padding: 12px 10px; font-size: 13px; }
            .result-bar { padding: 20px 16px; flex-direction: column; text-align: center; }
            .result-bar__total { text-align: center; }
            .actions-bar { padding: 14px 16px; flex-direction: column; align-items: stretch; }
            .action-btn { justify-content: center; }
            .order-check { justify-content: center; }
            .option-grid { grid-template-columns: 1fr 1fr; }
            .option-grid--lengths { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
            .qty-input { width: 100px; font-size: 18px; }
            .preview__pike { width: 60px; height: 60px; }
            .preview__pike img { width: 56px; height: 56px; }
            .preview__pike-empty { width: 56px; height: 56px; }
            .preview__label { width: 60px; }
            .preview__cable { min-width: 60px; }
            .order-section { padding-left: 14px; padding-right: 14px; }
            .order-section--open { padding: 18px 14px; }
            .order-section iframe { max-width: 100%; }
            .calc-footer { border-radius: 0 0 12px 12px; }
            .lightbox__content { padding: 16px; }
            .lightbox__image { max-height: 260px; }
        }

        /* ======== Печать ======== */
        @media print {
            *, *::before, *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
            body { background: #fff !important; padding: 0 !important; font-size: 12pt; }
            .calculator, .toast, .lightbox { display: none !important; }
            .print-sheet {
                display: block !important; max-width: 700px; margin: 0 auto; padding: 20px;
            }
            .print-sheet__header {
                text-align: center; border-bottom: 2px solid var(--brand);
                padding-bottom: 16px; margin-bottom: 24px;
            }
            .print-sheet__header h1 { font-size: 20pt; color: var(--brand-dark); margin-bottom: 4px; }
            .print-sheet__date { font-size: 10pt; color: var(--text-light); }
            .print-sheet__preview {
                display: flex; align-items: center; justify-content: center;
                padding: 20px 0 40px; position: relative;
            }
            .print-sheet__pike {
                width: 80px; height: 80px;
                display: flex; align-items: center; justify-content: center; flex-shrink: 0;
            }
			.print-sheet__pike--a { justify-content: flex-end; }
			.print-sheet__pike--b { justify-content: flex-start; }
            .print-sheet__pike img { width: 70px; height: 70px; object-fit: contain; }
            .print-sheet__pike--a img { transform: rotate(-90deg); }
            .print-sheet__pike--b img { transform: rotate(90deg); }
            .print-sheet__pike-empty {
                width: 70px; height: 70px; border: 2px dashed #ccc; border-radius: 50%;
                display: flex; align-items: center; justify-content: center;
                font-size: 10pt; color: #aaa;
            }
            .print-sheet__cable { flex: 1; max-width: 300px; min-width: 60px; position: relative; }
            .print-sheet__cable-wire {
                width: 100%; height: 4px; border-radius: 2px;
                background: repeating-linear-gradient(115deg, var(--brand) 0px, var(--brand) 3px, var(--brand-light) 3px, var(--brand-light) 6px);
            }
            .print-sheet__cable-label {
                position: absolute; top: 10px; left: 0; right: 0;
                font-size: 9pt; color: var(--text-light); text-align: center;
            }
            .print-sheet__cable-label b { color: var(--brand-dark); }
            .print-sheet__table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 11pt; }
            .print-sheet__table th {
                background: var(--brand-pale); color: var(--brand-dark);
                text-align: left; padding: 8px 12px; font-weight: 600; border-bottom: 2px solid var(--brand);
            }
            .print-sheet__table td { padding: 8px 12px; border-bottom: 1px solid #e0e0e0; }
            .print-sheet__table tr:last-child td { border-bottom: 2px solid var(--brand); }
            .print-sheet__total {
                text-align: right; padding: 16px 0; font-size: 18pt; font-weight: 800; color: var(--brand-dark);
            }
            .print-sheet__total small {
                display: block; font-size: 10pt; font-weight: 400; color: var(--text-light); margin-top: 4px;
            }
            .print-sheet__footer {
                margin-top: 30px; padding-top: 12px; border-top: 1px solid #ddd;
                font-size: 8pt; color: #aaa; text-align: center;
            }
        }
