:root {
    --ink: #18202a;
    --muted: #667085;
    --line: #d8dde5;
    --soft: #f5f6f8;
    --dark: #151922;
    --accent: #2f3b4a
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    padding: 0;
    background: #eef1f5;
    color: var(--ink);
    font: 15px/1.5 Arial,sans-serif
}

body {
    padding: 28px
}

.page {
    max-width: 1000px;
    margin: auto;
    background: #fff;
    box-shadow: 0 10px 35px #0001
}

header {
    padding: 42px 48px 30px;
    border-bottom: 1px solid var(--line)
}

.eyebrow {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700
}

h1 {
    font-size: 32px;
    line-height: 1.12;
    margin: 10px 0 8px
}

h2 {
    font-size: 20px;
    margin: 0 0 5px
}

h3 {
    font-size: 15px;
    margin: 18px 0 8px
}

.lead, .hint {
    color: var(--muted)
}

.lead {
    max-width: 820px
}

.hint {
    font-size: 13px;
    margin: 0 0 17px
}

.progress {
    height: 5px;
    background: #e9edf2;
    margin-top: 24px
}

.bar {
    height: 100%;
    width: 0;
    background: var(--dark)
}

main {
    padding: 28px 48px 50px
}

.section {
    margin-bottom: 34px;
    break-inside: avoid;
    overflow: visible;
    height: auto;
    max-height: none;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.full {
    grid-column: 1/-1
}

.field {
    margin-bottom: 12px;
    overflow: visible;
    width: 100%;
    min-width: 0;
}

label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px
}

input, textarea, select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 11px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    outline: 0;
    display: block;
    box-sizing: border-box;
}

textarea {
    min-height: 40px;
    height: auto;
    resize: vertical;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    field-sizing: content;
}

    input:focus, textarea:focus, select:focus {
        border-color: #667085;
        box-shadow: 0 0 0 3px #1118270b
    }

.checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.check {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-weight: 400
}

    .check input {
        width: auto;
        margin-top: 4px
    }

    .check span {
        font-weight: 400
    }

.card {
    background: var(--soft);
    border: 1px solid #e4e8ee;
    border-radius: 9px;
    padding: 15px;
    margin-top: 12px
}

.added {
    border-left: 3px solid #6b7280;
    padding-left: 12px
}

.added-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 5px
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px
}

button {
    border: 0;
    border-radius: 7px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--dark);
    color: #fff
}

    button.secondary {
        background: #edf0f3;
        color: var(--ink)
    }

    button.danger {
        background: #fff0f0;
        color: #b42318
    }

.note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px
}

@media(max-width:720px) {
    body {
        padding: 0
    }

    .page {
        box-shadow: none
    }

    header, main {
        padding-left: 20px;
        padding-right: 20px
    }

    .grid, .checks {
        grid-template-columns: 1fr
    }

    h1 {
        font-size: 27px
    }
}

/* ============================================================
   ПЕЧАТЬ / ЭКСПОРТ В PDF
   Здесь убираем всё, что вызывает дублирование полей
   ============================================================ */
@media print {
    body {
        background: #fff;
        padding: 0;
        font-size: 11px
    }

    .page {
        box-shadow: none;
        max-width: none
    }

    header {
        padding: 20px 28px 14px
    }

    main {
        padding: 14px 28px 22px
    }

    .no-print {
        display: none !important
    }

    .section {
        margin-bottom: 17px;
        overflow: visible;
        height: auto;
        max-height: none;
        break-inside: avoid;
    }

    .grid {
        gap: 9px;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .field {
        margin-bottom: 7px;
        overflow: visible;
        width: 100%;
        min-width: 0;
    }

    input, textarea, select {
        border: 0;
        border-bottom: 1px solid #bbb;
        border-radius: 0;
        padding: 3px 0;
        background: transparent;
        max-width: 100%;
        min-width: 0;
        display: block;
        width: 100%;
        box-shadow: none !important;
        outline: none !important;
        -webkit-appearance: none;
        appearance: none;
    }

    /* === ГЛАВНОЕ ИСПРАВЛЕНИЕ: убираем всё, что дублирует поля === */
    textarea {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        resize: none !important;
        overflow: hidden !important;
        field-sizing: fixed !important; /* отключаем field-sizing: content */
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        background: transparent !important;
        border: 0 !important;
        border-bottom: 1px solid #bbb !important;
        border-radius: 0 !important;
        padding: 3px 0 !important;
        box-shadow: none !important;
        -webkit-appearance: none;
        appearance: none;
    }

        /* Скрываем любые псевдо-отражения textarea, которые может создать html2pdf.js */
        textarea::after,
        textarea::before {
            display: none !important;
            content: none !important;
        }

    .check {
        padding: 4px 6px;
        border: 1px solid #ddd;
        border-radius: 0;
    }

        .check input {
            width: auto;
        }

    h2 {
        font-size: 16px
    }

    /* Отключаем тени и анимации, чтобы html2pdf.js не дублировал блоки */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================================
   ПРИНУДИТЕЛЬНЫЕ ПРАВИЛА (для экрана)
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

.grid > *,
.field,
.form-group {
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
}

textarea {
    min-height: 40px !important;
    height: auto !important;
    overflow-y: auto !important;
    resize: vertical !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    field-sizing: content !important;
}

.section,
.card,
main,
.page {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}
