/* Scroll global liberado */
html, body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #070d17;
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* =========================================================
   TEMA DE SINTAXE DO CODEMIRROR (DESIGN HUB DARK)
   ========================================================= */
.cm-s-designhub.CodeMirror {
    background-color: #1a202c !important;
    color: #f8fafc !important;
    font-family: 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    border: none !important;
}

#htmlEditorContainer .CodeMirror,
#cssEditorContainer .CodeMirror {
    height: 460px !important;
}

body.editor-mode-split #htmlEditorContainer .CodeMirror {
    height: 230px !important;
}

body.editor-mode-split #cssEditorContainer .CodeMirror {
    height: 300px !important;
}

.cm-s-designhub .CodeMirror-gutters {
    background-color: #1a202c !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-right: 8px !important;
}

.cm-s-designhub .CodeMirror-linenumber {
    color: #4b5563 !important;
    font-size: 12px !important;
}

.cm-s-designhub .CodeMirror-cursor {
    border-left: 2px solid #00d2ff !important;
}

.cm-s-designhub .CodeMirror-selected {
    background-color: rgba(56, 189, 248, 0.2) !important;
}

/* Cores de Sintaxe HTML e CSS */
.cm-s-designhub .cm-tag { color: #f43f5e !important; font-weight: 600 !important; } /* Tags: div, span */
.cm-s-designhub .cm-bracket { color: #f43f5e !important; }                          /* <, >, / */
.cm-s-designhub .cm-attribute { color: #4ade80 !important; }                        /* Atributos: class, id */
.cm-s-designhub .cm-string { color: #fef08a !important; }                           /* Strings: "blog-wrapper" */
.cm-s-designhub .cm-qualifier,
.cm-s-designhub .cm-builtin { color: #4ade80 !important; font-weight: 600 !important; } /* Seletores CSS: .post-canvas */
.cm-s-designhub .cm-property { color: #38bdf8 !important; }                         /* Propriedades: width, height */
.cm-s-designhub .cm-atom,
.cm-s-designhub .cm-number,
.cm-s-designhub .cm-unit { color: #c084fc !important; }                             /* Valores: 55%, absolute */
.cm-s-designhub .cm-variable,
.cm-s-designhub .cm-variable-2 { color: #f8fafc !important; }                       /* Variáveis CSS */
.cm-s-designhub .cm-comment { color: #64748b !important; font-style: italic !important; }

/* Botoes de Formato */
.ratio-btn {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.15s ease;
}
.ratio-btn:hover { color: #ffffff; }
.ratio-btn.active {
    background-color: #1e293b;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Canvas Viewport */
.post-canvas-wrapper {
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    background-color: #0f172a;
    position: relative;
    container-type: inline-size;
    container-name: post;
    display: flex;
}

.post-canvas-wrapper.ratio-4-5 { aspect-ratio: 4 / 5; }
.post-canvas-wrapper.ratio-1-1 { aspect-ratio: 1 / 1; }
.post-canvas-wrapper.ratio-9-16 { aspect-ratio: 9 / 16; }

.post-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Trava global contra estouro de logos */
.inject-logo img,
.inject-logo svg {
    max-height: 8cqi !important;
    max-width: 32cqi !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}