:root {
    --wvi-card: #fffdfa;
    --wvi-text: #172033;
    --wvi-muted: #667085;
    --wvi-line: #deded8;
    --wvi-accent: #3468f5;
    --wvi-accent-dark: #2856d2;
    --wvi-radius: 20px;
}

.wv-instr,
.wv-instr * { box-sizing: border-box; }

.wv-instr {
    width: 100%;
    max-width: 1240px;
    min-width: 0;
    container-type: inline-size;
    margin: 0 auto;
    padding: 12px 20px 60px;
    color: var(--wvi-text);
    font-family: Arial, Helvetica, sans-serif;
}

.wv-instr__intro { margin: 0 0 26px; }
.wv-instr__eyebrow {
    margin: 0 0 7px;
    color: #3468f5;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.wv-instr__lead {
    max-width: 790px;
    margin: 0;
    color: var(--wvi-muted);
    font-size: 17px;
    line-height: 1.55;
}

.wv-instr__layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    gap: 28px;
    align-items: start;
}

.wv-instr__panel,
.wv-instr__preview-wrap {
    min-width: 0;
    border: 1px solid var(--wvi-line);
    border-radius: var(--wvi-radius);
    background: var(--wvi-card);
    box-shadow: 0 14px 40px rgba(23,32,51,.06);
}
.wv-instr__panel { padding: 22px; }
.wv-instr__preview-wrap {
    position: sticky;
    top: 22px;
    padding: 18px;
}

.wv-instr-field { margin-bottom: 18px; }
.wv-instr-field label,
.wv-instr-choice legend {
    display: block;
    margin: 0 0 8px;
    color: #344054;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
}
.wv-instr-field input,
.wv-instr-field textarea,
.wv-instr-item input {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px 13px;
    border: 1px solid #d9dee8;
    border-radius: 12px;
    outline: none;
    color: var(--wvi-text);
    background: #fff;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.wv-instr-field textarea { min-height: 88px; resize: vertical; }
.wv-instr-field input:focus,
.wv-instr-field textarea:focus,
.wv-instr-item input:focus {
    border-color: rgba(52,104,245,.72);
    box-shadow: 0 0 0 3px rgba(52,104,245,.11);
}

.wv-instr-items-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 2px 0 10px;
}
.wv-instr-items-head strong {
    display: block;
    font-size: 17px;
    line-height: 1.2;
}
.wv-instr-items-head small {
    display: block;
    margin-top: 4px;
    color: var(--wvi-muted);
    font-size: 12px;
}
.wv-instr__add {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 13px;
    border: 0;
    border-radius: 11px;
    color: #244fc3;
    background: #edf2ff;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
}
.wv-instr__add:hover { background: #e3eaff; }

.wv-instr-items {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}
.wv-instr-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
}
.wv-instr-item__remove {
    display: inline-flex;
    width: 38px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d9dee8;
    border-radius: 11px;
    color: #98a2b3;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.wv-instr-item__remove:hover { color: #b5473d; border-color: #efc1bb; background: #fff7f5; }

.wv-instr-choice {
    min-width: 0;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}
.wv-instr-choice__grid { display: grid; gap: 8px; }
.wv-instr-choice__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wv-instr-choice__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wv-instr-choice__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wv-instr-choice label { min-width: 0; cursor: pointer; }
.wv-instr-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.wv-instr-choice span {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid #d9dee8;
    border-radius: 11px;
    color: #475467;
    background: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.wv-instr-choice input:checked + span {
    border-color: var(--wvi-accent);
    color: #244fc3;
    background: #edf2ff;
    box-shadow: inset 0 0 0 1px var(--wvi-accent);
}

.wv-instr__panel-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}
.wv-instr__reset {
    padding: 5px 0;
    border: 0;
    color: var(--wvi-muted);
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-size: 13px;
}

.wv-instr__preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.wv-instr__preview-head > div { min-width: 0; }
.wv-instr__preview-head span {
    display: block;
    color: var(--wvi-text);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}
.wv-instr__preview-head small {
    display: block;
    margin-top: 4px;
    color: var(--wvi-muted);
    font-size: 13px;
}

.wv-instr__preview {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 320px;
    padding: 12px;
    overflow: hidden;
    border-radius: 14px;
    background-color: #eef0f3;
    background-image:
        linear-gradient(45deg, #fff 25%, transparent 25%),
        linear-gradient(-45deg, #fff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #fff 75%),
        linear-gradient(-45deg, transparent 75%, #fff 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.wv-instr__preview svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 650px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(23,32,51,.10);
}

.wv-instr__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.wv-instr-btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid #d9dee8;
    border-radius: 11px;
    color: #344054;
    background: #fff;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    cursor: pointer;
}
.wv-instr-btn--primary {
    border-color: var(--wvi-accent);
    color: #fff;
    background: var(--wvi-accent);
}
.wv-instr-btn--primary:hover { background: var(--wvi-accent-dark); }
.wv-instr-btn--download-main { grid-column: 1 / -1; }
.wv-instr__privacy {
    margin: 11px 0 0;
    color: var(--wvi-muted);
    font-size: 12px;
    line-height: 1.45;
}
.wv-instr__preview-head [data-wv-instr-scroll-edit] { display: none; }

@container (max-width: 940px) {
    .wv-instr__layout { grid-template-columns: 1fr; }
    .wv-instr__preview-wrap { position: static; }
    .wv-instr__preview-head [data-wv-instr-scroll-edit] { display: inline-flex; }
    .wv-instr__preview svg { max-height: none; }
}

@container (max-width: 580px) {
    .wv-instr { padding-left: 0; padding-right: 0; }
    .wv-instr__lead { font-size: 15px; }
    .wv-instr__panel,
    .wv-instr__preview-wrap { border-radius: 16px; }
    .wv-instr__panel { padding: 16px; }
    .wv-instr__preview-wrap { padding: 14px; }
    .wv-instr-items-head { align-items: flex-end; }
    .wv-instr__add { max-width: 145px; }
    .wv-instr-choice__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wv-instr-choice__grid--3 { grid-template-columns: 1fr; }
    .wv-instr__actions { grid-template-columns: 1fr; }
    .wv-instr-btn--download-main { grid-column: auto; }
}

/* Быстрые действия: пустая форма загружается по умолчанию. */
.wv-instr__quick-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; margin:0 0 18px; }
.wv-instr__example, .wv-instr__reset-top { min-height:40px; padding:9px 16px; border-radius:10px; font-weight:700; font-size:13px; cursor:pointer; }
.wv-instr__example { border:1px solid var(--wvi-accent); background:var(--wvi-accent); color:#fff; }
.wv-instr__reset-top { border:1px solid var(--wvi-accent); background:#fff; color:var(--wvi-accent-dark); }
.wv-instr__example:hover { background:var(--wvi-accent-dark); }
.wv-instr__reset-top:hover { background:#eef3ff; }
.wv-instr__reset { color:var(--wvi-accent-dark); }
@media (max-width:560px) { .wv-instr__quick-actions > button { flex:1 1 calc(50% - 5px); } }


.wv-instr-field .wv-instr-char-count{display:block;margin-top:6px;color:var(--wv-muted);font-size:12px;text-align:right;}

/* 0.2.0 — единая система ВебВиро, как в Прайсе и Объявлении */
:root{--wvi-card:#ffffff;--wvi-bg:#f7f8fa;}
.wv-instr{
    background:#f7f8fa;
    box-shadow:0 0 0 100vmax #f7f8fa;
    clip-path:inset(0 -100vmax);
}
body:has(.wv-instr),
body:has(.wv-instr) .wv-main,
body:has(.wv-instr) .wv-shell,
body:has(.wv-instr) .wv-main article,
body:has(.wv-instr) .wv-entry{background:#f7f8fa !important;}
body:has(.wv-instr) .wv-main{box-shadow:0 0 0 100vmax #f7f8fa;clip-path:inset(0 -100vmax);}
body:has(.wv-instr) .wv-footer{background:#fffaf3 !important;border-top-color:#deded8 !important;}

.wv-instr__panel,.wv-instr__preview-wrap{background:#fff;}
.wv-instr__preview svg{border-radius:0;}
.wv-instr-add-row{display:flex;justify-content:flex-end;margin:-8px 0 18px;}
.wv-instr__add{display:block;margin-left:auto;}

/* Карточки дизайнов */
.wv-instr-design-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.wv-instr-design-grid[data-count="1"]{grid-template-columns:minmax(0,260px);}
.wv-instr-design-grid[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr));}
.wv-instr-design-grid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));}
.wv-instr-design-card{display:block;min-width:0;cursor:pointer;}
.wv-instr-design-card[hidden]{display:none !important;}
.wv-instr-design-card>input,.wv-instr-palette-card>input{position:absolute !important;opacity:0 !important;pointer-events:none !important;}
.wv-instr-choice .wv-instr-design-card__body{
    display:flex !important;min-height:148px !important;padding:10px !important;
    flex-direction:column !important;align-items:center !important;justify-content:flex-start !important;gap:7px !important;
    border:1px solid #d9dee8 !important;border-radius:13px !important;background:#fff !important;color:#344054 !important;
    box-shadow:none !important;text-align:center !important;
}
.wv-instr-choice .wv-instr-design-card__body strong{font-size:14px;line-height:1.2;color:#344054;}
.wv-instr-choice .wv-instr-design-card__body small{font-size:12px;line-height:1.35;color:#667085;}
.wv-instr-choice .wv-instr-design-card>input:checked+.wv-instr-design-card__body{border-color:#3468f5 !important;background:#f5f8ff !important;box-shadow:inset 0 0 0 1px #3468f5 !important;}
.wv-instr-choice .wv-instr-design-thumb{
    position:relative !important;display:flex !important;width:100% !important;height:58px !important;min-height:58px !important;
    padding:0 !important;align-items:center !important;justify-content:center !important;overflow:visible !important;
    border:0 !important;border-radius:0 !important;background:transparent !important;box-shadow:none !important;
}
.wv-instr-choice .wv-instr-design-thumb::before,.wv-instr-choice .wv-instr-design-thumb::after{box-sizing:border-box;}
/* Рамка */
.wv-instr[data-wv-instr-design-style="strict"] .wv-instr-design-thumb--1::before{
    content:"";display:block;width:36px;height:36px;border:2px solid #667085;border-radius:0;background:transparent;
}
/* Воздух */
.wv-instr[data-wv-instr-design-style="minimal"] .wv-instr-design-thumb--1::before{
    content:"";display:block;width:2px;height:42px;background:#cfd6e2;
}
/* Карточки */
.wv-instr[data-wv-instr-design-style="minimal"] .wv-instr-design-thumb--2::before,
.wv-instr[data-wv-instr-design-style="minimal"] .wv-instr-design-thumb--2::after{
    content:"";position:absolute;left:50%;width:38px;height:12px;border:1.5px solid #667085;border-radius:0;background:transparent;transform:translateX(-50%);
}
.wv-instr[data-wv-instr-design-style="minimal"] .wv-instr-design-thumb--2::before{top:13px;}
.wv-instr[data-wv-instr-design-style="minimal"] .wv-instr-design-thumb--2::after{top:32px;}
/* Типографика */
.wv-instr[data-wv-instr-design-style="minimal"] .wv-instr-design-thumb--3::before{
    content:"АБВ";display:block;color:#667085;font:700 23px/1 Arial,Helvetica,sans-serif;letter-spacing:.08em;
}
/* Таблица — как в Прайсе */
.wv-instr[data-wv-instr-design-style="business"] .wv-instr-design-thumb--1::before{
    content:"";display:block;width:44px;height:34px;border:1.5px solid #667085;border-radius:0;
    background:
      linear-gradient(#667085,#667085) 0 10px/100% 1px no-repeat,
      linear-gradient(#667085,#667085) 0 21px/100% 1px no-repeat,
      linear-gradient(#667085,#667085) 14px 0/1px 100% no-repeat,
      linear-gradient(#667085,#667085) 29px 0/1px 100% no-repeat,
      transparent;
}
/* Темный */
.wv-instr[data-wv-instr-design-style="contrast"] .wv-instr-design-thumb--1::before{content:"";display:block;width:36px;height:36px;background:#202736;border-radius:0;}

/* Палитры: квадраты строго по центру плашек */
.wv-instr-palette-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.wv-instr-palette-card{display:block;min-width:0;cursor:pointer;}
.wv-instr-choice .wv-instr-palette-card__body{
    display:flex !important;min-height:82px !important;padding:10px !important;flex-direction:column !important;
    align-items:center !important;justify-content:center !important;text-align:center !important;gap:8px !important;
    border:1px solid #d9dee8 !important;border-radius:13px !important;background:#fff !important;color:#344054 !important;box-shadow:none !important;
}
.wv-instr-choice .wv-instr-palette-card>input:checked+.wv-instr-palette-card__body{border-color:#3468f5 !important;background:#f5f8ff !important;box-shadow:inset 0 0 0 1px #3468f5 !important;}
.wv-instr-choice .wv-instr-palette-swatches{
    display:flex !important;min-height:0 !important;padding:0 !important;align-items:center !important;justify-content:center !important;gap:5px !important;
    border:0 !important;border-radius:0 !important;background:transparent !important;box-shadow:none !important;
}
.wv-instr-choice .wv-instr-palette-swatches i{display:block;width:18px;height:18px;border-radius:0;background:var(--sw);border:1px solid rgba(23,32,51,.10);}
.wv-instr-choice .wv-instr-palette-card__body strong{font-size:12px;color:#344054;}

@container (max-width:580px){
    .wv-instr-design-grid,.wv-instr-palette-grid{grid-template-columns:1fr;}
    .wv-instr-design-grid[data-count="2"],.wv-instr-design-grid[data-count="3"]{grid-template-columns:1fr;}
    .wv-instr-choice .wv-instr-design-card__body{min-height:112px !important;}
}

/* 0.2.0 — унификация Инструкции с остальными сервисами */
:root{--wvi-card:#ffffff;--wvi-bg:#f7f8fa;}
.wv-instr{background:#f7f8fa;box-shadow:0 0 0 100vmax #f7f8fa;clip-path:inset(0 -100vmax);}
body:has(.wv-instr),body:has(.wv-instr) .wv-main,body:has(.wv-instr) .wv-shell,body:has(.wv-instr) .wv-main article,body:has(.wv-instr) .wv-entry{background:#f7f8fa !important;}
body:has(.wv-instr) .wv-footer{background:#fffaf3 !important;border-top-color:#deded8;}
body:has(.wv-instr) .wv-main{box-shadow:0 0 0 100vmax #f7f8fa;clip-path:inset(0 -100vmax);}
.wv-instr__panel,.wv-instr__preview-wrap{background:#fff;}
.wv-instr__preview svg{border-radius:0 !important;}
.wv-instr-add-row{display:flex;justify-content:flex-end;margin:-8px 0 18px;}
.wv-instr__add{display:block;margin-left:auto;}
.wv-instr-char-count{display:block;margin-top:6px;color:var(--wvi-muted);font-size:12px;text-align:right;}
