.test-grid-lab { position: relative; }
.test-grid-lab__head,
.test-grid-lab__elements { display: none; }
.test-grid-lab__head { justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.test-grid-lab__elements-title { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.test-grid-lab__elements-list { display: flex; gap: .5rem; flex-wrap: wrap; }
.test-grid-lab__element-chip { border: 1px solid #212529; background: #fff; border-radius: .5rem; padding: .35rem .7rem; font-weight: 600; cursor: grab; }
.test-grid-lab__element-empty { color: #6c757d; font-size: .9rem; }

.test-grid-lab__modal { position: fixed; inset: 0; z-index: 1055; }
.test-grid-lab__modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.test-grid-lab__modal-card { position: relative; z-index: 1; width: min(700px, calc(100% - 2rem)); margin: 8vh auto 0; background: #fff; border-radius: .75rem; padding: 1rem; }
.test-grid-lab__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.test-grid-lab__form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }

.test-grid-lab__modal-toolbar { margin-top: .8rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.test-grid-lab__modal-toolbar span { font-size: .9rem; color: #495057; min-width: 180px; }

.test-grid-lab__preview-wrap { margin-top: .8rem; }
.test-grid-lab__preview-title { font-size: .85rem; color: #495057; margin-bottom: .35rem; }
.test-grid-lab__preview { display: grid; gap: 8px; min-height: 130px; background: #f6f6f6; border: 1px solid #dee2e6; border-radius: .6rem; padding: .4rem; }
.test-grid-lab__preview-cell { background: #ececec; border: 1px solid #999; border-radius: .4rem; min-height: 54px; cursor: pointer; position: relative; }
.test-grid-lab__preview-cell.is-selected { outline: 2px solid #fd7e14; border-color: #fd7e14; }
.test-grid-lab__preview-cell.is-merged { background: #dfeeff; border-color: #0d6efd; }
.test-grid-lab__preview-merge-badge { position: absolute; top: .25rem; left: .35rem; font-size: .7rem; padding: .05rem .35rem; border-radius: 99px; background: #0d6efd; color: #fff; }
.test-grid-lab__preview-unmerge { position: absolute; top: .25rem; right: .25rem; border: 0; width: 1.2rem; height: 1.2rem; border-radius: 99px; background: #dc3545; color: #fff; line-height: 1; }

.test-grid-lab__modal-actions { display: flex; justify-content: end; gap: .5rem; margin-top: 1rem; }

.test-grid-text-toolbar {
    position: fixed;
    z-index: 25000;
    width: min(228px, calc(100vw - 10px));
    max-height: min(62vh, 360px);
    overflow: auto;
    padding: .3rem;
    border-radius: .65rem;
    background: #f7f9fd;
    border: 1px solid #d4ddec;
    box-shadow: 0 8px 18px rgba(16, 24, 40, .11);
    display: flex;
    flex-wrap: wrap;
    gap: .26rem;
}

.test-grid-text-toolbar__group + .test-grid-text-toolbar__group {
    margin-top: 0;
}

.test-grid-text-toolbar__group {
    background: transparent;
    border: 0;
    border-right: 1px solid #d7dfeb;
    padding: 0 .22rem 0 0;
    margin: 0 .08rem 0 0;
    min-width: auto;
}

.test-grid-text-toolbar__group:last-child {
    border-right: 0;
    padding-right: 0;
    margin-right: 0;
}

.test-grid-text-toolbar__title {
    display: none;
}

.test-grid-text-toolbar__title::before {
    display: none;
}

.test-grid-text-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
}

.test-grid-text-toolbar button {
    border: 1px solid #bccbe0;
    border-radius: .42rem;
    background: #fff;
    min-width: 28px;
    width: 28px;
    height: 28px;
    font-size: 0;
    font-weight: 700;
    color: #1f406d;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.test-grid-text-toolbar button:hover {
    border-color: #91a7c8;
    background: #f4f8ff;
}

.test-grid-text-toolbar button.is-active {
    background: #2f61cb;
    border-color: #2f61cb;
    color: #fff;
}

.test-grid-text-toolbar button::before {
    content: "";
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.test-grid-text-toolbar button[data-grid-size]::before {
    content: none;
}

.test-grid-text-toolbar button[data-grid-size] {
    width: 30px;
    min-width: 30px;
    font-size: .66rem;
    font-weight: 800;
    line-height: 1;
}

.test-grid-text-toolbar button[data-grid-color]::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: currentColor;
}

.test-grid-text-toolbar button[data-grid-color="#1e4fa6"] { color: #1e4fa6; }
.test-grid-text-toolbar button[data-grid-color="#101828"] { color: #101828; }
.test-grid-text-toolbar button[data-grid-color].is-active { color: #ffffff; }

.test-grid-text-toolbar button[data-icon="h2"]::before,
.test-grid-text-toolbar button[data-icon="h3"]::before,
.test-grid-text-toolbar button[data-icon="p"]::before {
    -webkit-mask-image: none;
    mask-image: none;
    content: "";
    width: auto;
    height: auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .01em;
}

.test-grid-text-toolbar button[data-icon="h2"]::before { content: "H2"; }
.test-grid-text-toolbar button[data-icon="h3"]::before { content: "H3"; }
.test-grid-text-toolbar button[data-icon="p"]::before { content: "P"; }

.test-grid-text-toolbar button[data-grid-block="h2"],
.test-grid-text-toolbar button[data-grid-block="h3"] {
    width: 36px;
    min-width: 36px;
    font-size: 11px;
    font-weight: 900;
}

.test-grid-text-toolbar button[data-icon="h2"]::before,
.test-grid-text-toolbar button[data-icon="h3"]::before {
    content: none;
}

.test-grid-text-toolbar button[data-icon="ul"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='2.5' cy='3' r='1.2' fill='black'/%3E%3Ccircle cx='2.5' cy='8' r='1.2' fill='black'/%3E%3Ccircle cx='2.5' cy='13' r='1.2' fill='black'/%3E%3Crect x='5' y='2.1' width='9' height='1.8' rx='.6' fill='black'/%3E%3Crect x='5' y='7.1' width='9' height='1.8' rx='.6' fill='black'/%3E%3Crect x='5' y='12.1' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='2.5' cy='3' r='1.2' fill='black'/%3E%3Ccircle cx='2.5' cy='8' r='1.2' fill='black'/%3E%3Ccircle cx='2.5' cy='13' r='1.2' fill='black'/%3E%3Crect x='5' y='2.1' width='9' height='1.8' rx='.6' fill='black'/%3E%3Crect x='5' y='7.1' width='9' height='1.8' rx='.6' fill='black'/%3E%3Crect x='5' y='12.1' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="button"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1.8' y='3.2' width='12.4' height='9.6' rx='2.2' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1.8' y='3.2' width='12.4' height='9.6' rx='2.2' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="bold"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2h4.5c2 0 3.2 1.1 3.2 2.7 0 1-.5 1.8-1.4 2.2 1.2.4 1.9 1.3 1.9 2.6 0 2-1.5 3.3-3.8 3.3H4V2zm2 1.7v2.5h2.2c1 0 1.6-.5 1.6-1.3 0-.8-.6-1.2-1.6-1.2H6zm0 4.1v2.8h2.5c1.1 0 1.8-.5 1.8-1.4 0-.9-.7-1.4-1.8-1.4H6z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2h4.5c2 0 3.2 1.1 3.2 2.7 0 1-.5 1.8-1.4 2.2 1.2.4 1.9 1.3 1.9 2.6 0 2-1.5 3.3-3.8 3.3H4V2zm2 1.7v2.5h2.2c1 0 1.6-.5 1.6-1.3 0-.8-.6-1.2-1.6-1.2H6zm0 4.1v2.8h2.5c1.1 0 1.8-.5 1.8-1.4 0-.9-.7-1.4-1.8-1.4H6z' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="underline"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2v5c0 2.2 1.6 3.5 4 3.5s4-1.3 4-3.5V2h-2v5c0 1.1-.8 1.8-2 1.8s-2-.7-2-1.8V2H4zM3 13h10v1.8H3V13z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2v5c0 2.2 1.6 3.5 4 3.5s4-1.3 4-3.5V2h-2v5c0 1.1-.8 1.8-2 1.8s-2-.7-2-1.8V2H4zM3 13h10v1.8H3V13z' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="italic"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 2h6v1.8h-2.2L8.2 12.2h2.3V14h-6v-1.8h2.2L8.8 3.8H6.5V2z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 2h6v1.8h-2.2L8.2 12.2h2.3V14h-6v-1.8h2.2L8.8 3.8H6.5V2z' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="reset"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.2a5.8 5.8 0 1 1-5.3 8.2h2.1A3.9 3.9 0 1 0 8 4.1V6L4.5 3.3 8 .6v1.6z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.2a5.8 5.8 0 1 1-5.3 8.2h2.1A3.9 3.9 0 1 0 8 4.1V6L4.5 3.3 8 .6v1.6z' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="align-left"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2' y='2' width='10' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='6' width='12' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='10' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2' y='2' width='10' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='6' width='12' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='10' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="align-center"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='2' width='10' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='6' width='12' height='1.8' rx='.6' fill='black'/%3E%3Crect x='3.5' y='10' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='2' width='10' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='6' width='12' height='1.8' rx='.6' fill='black'/%3E%3Crect x='3.5' y='10' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="align-right"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='4' y='2' width='10' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='6' width='12' height='1.8' rx='.6' fill='black'/%3E%3Crect x='5' y='10' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='4' y='2' width='10' height='1.8' rx='.6' fill='black'/%3E%3Crect x='2' y='6' width='12' height='1.8' rx='.6' fill='black'/%3E%3Crect x='5' y='10' width='9' height='1.8' rx='.6' fill='black'/%3E%3C/svg%3E"); }
.test-grid-text-toolbar button[data-icon="link"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.8 10.6 5.4 12a2.3 2.3 0 0 1-3.2-3.2l2.2-2.2a2.3 2.3 0 0 1 3.2 0l.4.4-1.2 1.2-.4-.4a.7.7 0 0 0-1 0L3.2 10a.7.7 0 1 0 1 1l1.4-1.4 1.2 1.1zm2.4-5.2L10.6 4a2.3 2.3 0 0 1 3.2 3.2l-2.2 2.2a2.3 2.3 0 0 1-3.2 0l-.4-.4 1.2-1.2.4.4a.7.7 0 0 0 1 0L12.8 6a.7.7 0 1 0-1-1l-1.4 1.4-1.2-1z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.8 10.6 5.4 12a2.3 2.3 0 0 1-3.2-3.2l2.2-2.2a2.3 2.3 0 0 1 3.2 0l.4.4-1.2 1.2-.4-.4a.7.7 0 0 0-1 0L3.2 10a.7.7 0 1 0 1 1l1.4-1.4 1.2 1.1zm2.4-5.2L10.6 4a2.3 2.3 0 0 1 3.2 3.2l-2.2 2.2a2.3 2.3 0 0 1-3.2 0l-.4-.4 1.2-1.2.4.4a.7.7 0 0 0 1 0L12.8 6a.7.7 0 1 0-1-1l-1.4 1.4-1.2-1z' fill='black'/%3E%3C/svg%3E"); }

.test-grid-text-toolbar select,
.test-grid-text-toolbar input[type="color"] {
    min-height: 30px;
    border: 1px solid #bccbe0;
    border-radius: .5rem;
    background: #fff;
}

.test-grid-text-toolbar input[type="color"] {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
}

.pb-grid-v1__content.is-invert,
.pb-grid-v1__content .is-invert {
    background: transparent;
    color: inherit;
    border-radius: 0;
    padding: 0;
    font-style: italic;
}

.pb-grid-v1__content .bhkw-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: .35rem .85rem;
    border-radius: .5rem;
    text-decoration: none;
}

@media (max-width: 860px) {
    .test-grid-text-toolbar {
        width: min(212px, calc(100vw - 8px));
        max-height: min(58vh, 320px);
        padding: .25rem;
        gap: .22rem;
    }

    .test-grid-text-toolbar__group:last-child {
        border-right: 0;
    }

    .test-grid-text-toolbar__row {
        gap: .18rem;
    }
}

