    /* оформление окна визуального редактора */
    .wysi-active #main-reply,
    form[action]:not(.wysi-active) #wysi-reply,
    .wysi-active .button[name="preview"] {
        display: none;
    }

    #main-reply[rows="13"],
    #main-reply[rows="13"]~#wysi-reply,
    #pun-viewtopic .resizable-textarea~#wysi-reply {
        height: 15em;
    }

    #main-reply[rows="20"],
    #main-reply[rows="20"]~#wysi-reply,
    .punbb:not(#pun-viewtopic) .resizable-textarea~#wysi-reply {
        height: 25em;
    }

    /* #main-reply {
            outline-offset: 1px;
        } */

    #wysi-reply {
        -moz-appearance: textfield-multiline;
        -webkit-appearance: textarea;
        appearance: textarea;
        position: relative;
        display: inline-block;
        width: 100%;
        border: 1px solid #999;
        /*margin-bottom: 2px;*/
        padding: 2px;
        outline-offset: 1px;
        overflow-y: auto;
        overflow-x: hidden;
        resize: vertical;
    }

    .resizable-textarea .grippie {
        display: none !important;
    }

    @supports (-webkit-backdrop-filter: blur(1px)) {
        #wysi-reply {
            outline-offset: -3px;
        }
    }

    @media screen and (max-width:540px) {
        #wysi-reply {
            /*font-size: 14px;*/
            padding: 1.5%;
            max-width: 95%;
        }

        #main-reply[rows="13"],
        #main-reply[rows="13"]~#wysi-reply,
        #pun-viewtopic .resizable-textarea~#wysi-reply {
            height: 80vw;
        }

        #main-reply[rows="20"],
        #main-reply[rows="20"]~#wysi-reply,
        .punbb:not(#pun-viewtopic) .resizable-textarea~#wysi-reply {
            height: 110vw;
        }
    }

    /* оформление содержимого окна визуального редактора */
    #wysi-reply a {
        cursor: pointer;
        text-decoration: underline;
    }

    /*#wysi-reply :not(p)[data-wysi-highlight] {*/
    #wysi-reply [data-wysi-highlight] {
        outline: solid 0px rgba(0, 0, 0, .2);
    }

    #wysi-reply div[data-wysi-highlight] {
        outline-width: 2px;
    }

    #wysi-reply div>div[data-wysi-highlight] {
        outline: none;
    }

    #wysi-reply .quote-box>cite,
    #wysi-reply .code-box>.legend {
        /*pointer-events: none;*/
        user-select: none;
    }

    #wysi-reply .scrollbox {
        overflow: visible;
        height: auto !important;
        min-height: 2.5em;
        max-height: unset;
    }

    #wysi-reply .code-box pre {
        white-space: pre-wrap;
    }

    #wysi-reply p:empty::before,
    #wysi-reply pre:empty::before,
    #wysi-reply .wysi-empty::before {
        content: '\200B';
    }

    #wysi-reply .wysi-empty[data-wysi-highlight],
    #wysi-reply blockquote,
    #wysi-reply table td {
        position: relative;
        overflow: hidden;
    }

    #wysi-reply .wysi-empty:not([data-wysi-highlight]) {
        position: absolute;
        width: 100%;
        padding: .8em;
        margin: -.8em;
        /*margin-top: -.7em;
        margin-bottom: -.9em;*/
        z-index: 1;
    }

    #wysi-reply .wysi-empty:not([data-wysi-highlight]):not(:only-of-type)::after {
        content: "";
        display: block;
        width: 100%;
        position: absolute;
        top: .8em;
        left: 0;
        border: none;
        cursor: text;
    }

    #wysi-reply div+.wysi-empty:not([data-wysi-highlight])::after {
        top: 0;
    }

    #wysi-reply .wysi-empty:not([data-wysi-highlight]):hover::after {
        border-top: dashed 1px rgba(0, 0, 0, .2);
    }

    #wysi-reply li .wysi-empty:not([data-wysi-highlight])::after {
        content: none;
    }

    #wysi-reply .spoiler-box>div[onclick] {
        position: relative;
        z-index: 2;
    }

    #wysi-reply span[id]::before {
        content: '#' attr(id);
        position: absolute;
        margin-top: 1.4em;
        padding: 0 .5em;
        color: #555;
        background: rgba(220, 220, 220, .7);
        font-size: .8em;
        border-radius: .3em;
    }

    #wysi-reply .wysi-html-content {
        /*position: relative;*/
        height: 5em;
        resize: vertical;
        font-family: Courier new, monospace;
    }

    #wysi-reply .html-content {
        position: relative;
    }

    #wysi-reply .html-post-box:hover .html-content,
    #wysi-reply .html-post-box[data-wysi-highlight] .html-content {
        background: rgba(0, 0, 0, .05);
    }

    #wysi-reply .html-post-box .wysi-html-toggle {
        display: inline-block;
        position: absolute;
        height: 3em;
        width: 3em;
        cursor: pointer;
        opacity: 0;
        font-size: .75em;
        outline: none;
        transition: opacity .2s ease;
        z-index: 2;
    }

    #wysi-reply .html-post-box:hover .wysi-html-toggle {
        opacity: .8;
    }

    #wysi-reply .html-post-box .wysi-html-toggle:hover {
        opacity: 1;
    }

    #wysi-reply .wysi-html-toggle::before {
        content: "</>";
        display: inline-block;
        position: absolute;
        top: 0;
        left: 0;
        height: 3em;
        line-height: 3em;
        width: 3em;
        text-align: center;
        font-weight: 700;
        color: #555;
        background: rgba(220, 220, 220, 1);
        border: solid 1px #ccc;
        border-radius: .5em;
    }

    @media screen and (max-width: 540px) {
        #wysi-reply .html-post-box .wysi-html-toggle {
            opacity: .8;
            visibility: visible;
        }
    }

    /* элементы формы, содержащей визуальный редактор */
    .wysi-hidden {
        display: none;
    }

    .wysi-active .wysi-hidden {
        display: block;
    }

    .wysi-active #tags .container {
        z-index: 3;
    }

    .wysi-active #table-area table {
        margin: 0 auto;
    }

    #table-area #wysi-table {
        max-width: 22em;
    }

    #table-area #wysi-table a {
        display: inline-block;
        margin: .5em .7em 0 .7em;
    }

    .wysi-active #form-buttons.wysi-disabled,
    .wysi-active #tags.wysi-disabled .container>div,
    .wysi-active #tags.wysi-disabled #color-area td,
    .wysi-active #tags.wysi-disabled #keyboard-area>span {
        opacity: .5;
        cursor: not-allowed !important;
    }

    .wysi-active #form-buttons.wysi-disabled td,
    .wysi-active #tags.wysi-disabled img[onclick],
    .wysi-active #tags.wysi-disabled span[onclick],
    .wysi-active #tags.wysi-disabled input[onclick] {
        pointer-events: none;
    }

    /* элементы переключения между wysiwyg и bbcode */
    .formsubmit #wysi-mode {
        display: none;
    }

    strong#wysi-mode {
        font-weight: normal;
    }

    strong#wysi-mode a {
        font-weight: bold;
    }

    /* подсветка активных элементов формы и визуального редактора */
    #form-buttons td.wysi-highlight,
    form[action] div[id$="-area"] div.wysi-highlight {
        background-color: rgba(0, 0, 0, .1);
    }

    form[action] div[id$="-area"] td.wysi-highlight img {
        outline: solid 3px rgba(0, 0, 0, .25);
    }

    /* фикс для вложенного [u] в [i] */
    .post-content span[style*="italic"] em.bbuline {
        font-style: italic;
    }

    /* специальные элементы */
    #__WYSI_FOCUS_ANCHOR__ {
        position: absolute;
        opacity: 0;
    }

    link[rel="stylesheet"][href*="/wysi."]::before {
        content: "0.1.32";
        display: none;
    }