.blocos-shell {
    display: grid;
    gap: 22px;
}

.blocos-hero {
    display: grid;
    gap: 14px;
}

.blocos-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.blocos-hero__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.blocos-context-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.blocos-context-box {
    padding: 16px 14px;
    border-radius: 18px;
    background: rgba(185, 226, 231, 0.28);
    border: 1px solid rgba(123, 189, 196, 0.5);
}

.blocos-context-box span {
    display: block;
    margin-bottom: 6px;
    color: #61758a;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.blocos-context-box strong {
    display: block;
    color: #173f20;
    font-size: 1.02rem;
    line-height: 1.35;
}

.sticker-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.sticker-picker-empty {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .7);
    border: 1px dashed rgba(123, 189, 196, 0.58);
    color: #61758a;
}

.sticker-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 126px;
    padding: 14px 12px;
    border: 1px solid rgba(123, 189, 196, 0.5);
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    color: #4f6780;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.sticker-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(69, 95, 101, 0.10);
    border-color: rgba(95, 185, 192, 0.82);
}

.sticker-chip.is-selected {
    background: linear-gradient(180deg, rgba(230, 248, 249, .96) 0%, rgba(206, 237, 240, .96) 100%);
    border-color: #5fb9c0;
    box-shadow: 0 12px 22px rgba(69, 95, 101, 0.12);
}

.sticker-chip img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.sticker-chip span {
    display: block;
    line-height: 1.3;
}

.blocos-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(186, 225, 230, 0.56);
    color: #4f6780;
    font-weight: 700;
    font-size: .84rem;
    text-transform: lowercase;
}

.blocos-empty {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .68);
    border: 1px dashed rgba(123, 189, 196, 0.58);
    color: #61758a;
}

/* =========================================================
   ETAPA 1 — EDITOR VISUAL COM TINYMCE
   ========================================================= */

.is-hidden-by-type {
    display: none !important;
}

.preview-bloco-frame {
    display: block;
    width: 100%;
    min-height: 860px;
    border: 0;
    border-radius: 22px;
    background: #fff;
}

/* =========================================================
   EDITOR DE CÓDIGO HTML
   ========================================================= */

.bloco-codigo-editor {
    border: 1px solid rgba(123, 189, 196, 0.55);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 18px rgba(69, 95, 101, 0.08);
}

.bloco-codigo-editor__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #f0f8fa;
    border-bottom: 1px solid rgba(123, 189, 196, 0.35);
    font-family: 'SFMono-Regular', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #3a6070;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bloco-codigo-editor__header svg {
    flex-shrink: 0;
    opacity: .65;
}

.bloco-codigo-btn-formatar,
.bloco-codigo-btn-limpar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(123, 189, 196, 0.5);
    background: rgba(255,255,255,.8);
    color: #3a6070;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .14s, border-color .14s;
}

.bloco-codigo-btn-limpar {
    margin-left: 6px;
    color: #a05050;
    border-color: rgba(200, 120, 120, 0.35);
}

.bloco-codigo-btn-formatar:hover { background: #e4f4f6; border-color: rgba(29,116,130,.4); }
.bloco-codigo-btn-limpar:hover   { background: #fdf0f0; border-color: rgba(200,80,80,.4); }

.bloco-codigo-textarea {
    display: block;
    width: 100%;
    min-height: 440px;
    padding: 18px 22px;
    font-family: 'SFMono-Regular', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 13.5px;
    line-height: 1.75;
    color: #1d3444;
    background: #fafcfd;
    border: none;
    border-radius: 0;
    resize: vertical;
    outline: none;
    tab-size: 2;
    box-sizing: border-box;
    transition: background .15s;
}

.bloco-codigo-textarea:focus {
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(29, 116, 130, 0.16);
}

.bloco-codigo-textarea::placeholder {
    color: #9ab8c4;
    font-style: italic;
}

.bloco-codigo-editor__footer {
    padding: 10px 18px 12px;
    background: #f4fafb;
    border-top: 1px solid rgba(123, 189, 196, 0.28);
}

.bloco-codigo-editor__footer small {
    font-size: 12px;
    color: #61778a;
    line-height: 1.55;
}

.bloco-codigo-editor__footer strong {
    font-weight: 700;
    color: #3a6070;
}


@media (max-width: 980px) {
    .blocos-context-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .blocos-hero__top {
        flex-direction: column;
        align-items: stretch;
    }

    .blocos-context-grid {
        grid-template-columns: 1fr;
    }

    .sticker-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-bloco-frame {
        min-height: 720px;
    }
}

@media (max-width: 520px) {
    .sticker-picker {
        grid-template-columns: 1fr;
    }

    .preview-bloco-frame {
        min-height: 620px;
    }
}

