:root {
    /* Define Light Theme variables */
    --font-serif: 'Lora', serif;
    --font-mono: 'Fira Code', monospace;
    --text-color: #3a3a3a;
    --bg-color: #ffffff;
    --border-color: #eaeaea;
    --accent-light: #f0f3f5;
    --code-bg: #f5f5f5;
    --subtle-text: #999;
}

body.dark-mode {
    /* Redefine variables for Dark Theme */
    --text-color: #c9d1d9;
    --bg-color: #0d1117;
    --border-color: #30363d;
    --accent-light: #222a35;
    --code-bg: #161b22;
    --subtle-text: #8b949e;
}

body, html {
    margin: 0; padding: 0;
    height: 100%;
    font-family: var(--font-serif);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Milkdown Editor Integration --- */
#milkdown-editor {
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.milkdown-editor {
    height: 100%;
    padding: 2.5em 3em 4em 3em !important;
    line-height: 1.8 !important;
    font-size: 18px !important;
}
.prosemirror {
    font-family: var(--font-serif) !important;
    color: var(--text-color) !important;
    height: 100%;
    transition: color 0.3s ease;
}
.ProseMirror.ProseMirror-focused {
    outline: none !important;
    box-shadow: none !important;
}
.prosemirror h1, .prosemirror h2, .prosemirror h3 {
    font-family: var(--font-serif) !important;
    border-color: var(--border-color) !important; /* Theme h1 border */
    transition: border-color 0.3s ease;
}
.prosemirror pre {
    font-family: var(--font-mono) !important;
    background-color: var(--code-bg) !important;
    border: 1px solid var(--border-color) !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.prosemirror code {
    background-color: var(--accent-light) !important;
    color: var(--text-color) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.prosemirror blockquote {
    border-left-color: var(--border-color) !important;
    color: var(--subtle-text) !important;
    transition: border-color 0.3s ease, color 0.3s ease;
}
.prosemirror hr {
    background-color: var(--border-color) !important;
}

/* Checkbox / Task List Styling */
.prosemirror .task-list-item {
    display: flex;
    align-items: center;
}
.prosemirror .task-list-item > .task-list-item-checkbox {
    margin-right: 0.5em;
    height: 1em;
    width: 1em;
}
.prosemirror li[data-checked="true"] {
    text-decoration: line-through;
    color: var(--subtle-text);
}