body {
    margin: 0;
    font-family: monospace;
    background: #1e1e1e;
    color: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #222;
    border-bottom: 1px solid #444;
    z-index: 10;
}

/* container da direita */
.topbar-right {
    margin-left: auto;
}    
/* BOTÕES ESTILIZADOS */
button {
    padding: 6px 14px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background: #1a3a5a; /* azul escuro */
    color: white;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background: #336699; /* azul mais claro ao passar o mouse */
}

/* INPUT DE ARQUIVO ESCONDIDO */
input[type="file"] {
    display: none;
}

/* ÁREA PRINCIPAL */
#main {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* mantém o flex container limitado */
}

#editor {
    width: 50%;
    flex-shrink: 1; /* permite que encolha dentro do flex */
    height: auto;    /* deixa o flex gerenciar a altura */
    background: #1e1e1e;
    color: white;
    border: none;
    padding: 15px;
    resize: none;
    outline: none;
    font-size: 14px;
    overflow-y: auto;
    min-height: 0;  /* evita que ultrapasse o container */
}

#preview {
    width: 50%;
    padding: 15px;
    overflow-y: auto;
    background: #252525;
}

/* Preview Blocks */
.category {
    color: #4ea6ff;
    font-weight: bold;
    margin-top: 15px;
}

.line {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
}

.block {
    background: #2e2e2e;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: pre-wrap;
    color: white;
}

/* SCROLLBAR PERSONALIZADA */
#editor::-webkit-scrollbar,
#preview::-webkit-scrollbar {
    width: 8px;
}

#editor::-webkit-scrollbar-track,
#preview::-webkit-scrollbar-track {
    background: transparent; /* sem trilho visível */
}

#editor::-webkit-scrollbar-thumb,
#preview::-webkit-scrollbar-thumb {
    background: #555; /* retângulo cinza discreto */
    border-radius: 4px;
}

#editor::-webkit-scrollbar-thumb:hover,
#preview::-webkit-scrollbar-thumb:hover {
    background: #777; /* levemente mais claro ao passar o mouse */
}

/* SCROLLBAR FIREFOX */
#editor, #preview {
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}