* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.toolbar {
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-title {
    font-weight: 600;
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
}

.toolbar-actions {
    display: flex;
    gap: 6px;
}

button {
    padding: 6px 12px;
    border: 1px solid var(--button-border);
    border-radius: 5px;
    background: var(--button-bg);
    color: var(--text);
    cursor: pointer;
}

button[isIcon] {
    border: 0 solid var(--button-border) !important;
    border-radius: 5px;
    background: none;
    color: var(--text);
    padding: 6px 8px;
}

button[isIcon] i {
    font-size: 18px;
}

button:hover:not(:disabled) {
    background: var(--button-hover);
}

button:disabled {
    opacity: .45;
    cursor: default;
}

.file-name,
.preview-margin-box {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-container {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5px minmax(0, 1fr);
}

#editor {
    width: 100%;
    height: 100%;
    padding: 24px;
    resize: none;
    border: 0;
    outline: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 "Cascadia Code", "Consolas", monospace;
}

.empty-preview {
    color: var(--empty-text);
}

.preview {
    background: var(--bg);
    color: var(--text);
}

.status-bar {
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--status-text);
    font-size: 12px;
}

.editor-divider {
    width: 5px;
    height: 100%;
    background: var(--border);
    cursor: col-resize;
    user-select: none;
    touch-action: none;
}

.editor-divider:hover {
    background: var(--scrollbar-hover);
}

.editor-divider.dragging {
    background: var(--divider-drag);
}


/* =========================================================
   TITLE + IMAGE
   ========================================================= */

.title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.title img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}







/* =========================================================
   SCROLLBAR COLOR ADJUSTMENT
   ========================================================= */

html,
body,
#editor,
.preview {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#editor::-webkit-scrollbar,
.preview::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
#editor::-webkit-scrollbar-track,
.preview::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
#editor::-webkit-scrollbar-thumb,
.preview::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 4px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
#editor::-webkit-scrollbar-thumb:hover,
.preview::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
#editor::-webkit-scrollbar-corner,
.preview::-webkit-scrollbar-corner {
    background: transparent;
}