
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --color-bg: #ffffff;
    --color-text: #111827;
    --color-border: #e5e7eb;
    --color-sidebar-bg: #ffffff;
    --color-code-bg: #1f2937;
    --color-code-text: #f3f4f6;
    --color-highlight: #fef08a; /* Yellow-200 */
    --color-primary: #22c55e;
    --color-primary-light: #dcfce7;
    --color-primary-text: #166534;
    --color-tip-bg: #dcfce7;
    --color-tip-border: #22c55e;
    --color-important-bg: #eff6ff;
    --color-important-border: #3b82f6;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #f59e0b;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.layout { display: grid; grid-template-columns: 280px 1fr; height: 100vh; }
.sidebar {
    background-color: var(--color-sidebar-bg);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}
.sidebar-header { margin-bottom: 1.5rem; }
.sidebar-title { font-size: 1.25rem; font-weight: 800; color: var(--color-text); text-decoration: none; }
#search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: all 0.2s;
}
#search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3); }
#search-results { margin-bottom: 1rem; }
#search-results ul { list-style: none; padding: 0; margin: 0; }
#search-results a {
    display: block; padding: 0.25rem 0; font-size: 0.875rem; color: #475569; text-decoration: none; border-radius: 0.25rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#search-results a:hover { color: var(--color-primary); }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav a {
    display: block; padding: 0.5rem 1rem; color: #475569; text-decoration: none; border-radius: 0.375rem; font-weight: 500;
    transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-nav a:hover { color: var(--color-text); background-color: #f1f5f9; }
.sidebar-nav a.active { color: var(--color-primary); font-weight: 600; background-color: var(--color-primary-light); }
.nav-group { margin-bottom: 1.5rem; }
.nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary-text);
    padding: 0.5rem 1rem;
}

.nav-group-title button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    text-align: left;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-group-title button::after {
    content: '▾';
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.nav-group-title button[aria-expanded="false"]::after {
    transform: rotate(-90deg);
}
.sidebar-footer { 
    margin-top: auto; 
    padding-top: 1.5rem; 
    font-size: 0.875rem; 
    color: #6b7280;
    border-top: 1px solid var(--color-border);
}
.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}
.social-links a {
    color: #6b7280;
    transition: color 0.2s;
}
.social-links a:hover {
    color: var(--color-primary);
}
.sidebar-footer p {
    margin: 0 0 0.5rem 0;
}
.sidebar-footer a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}
.sidebar-footer a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}
.main-content { overflow-y: auto; padding: 3rem; }
.main-content-wrapper { max-width: 65ch; margin: 0 auto; }
.hamburger { display: none; position: fixed; top: 1rem; left: 1rem; z-index: 100; background: white; border: 1px solid var(--color-border); border-radius: 0.5rem; padding: 0.5rem; cursor: pointer; }
.prose { line-height: 1.7; font-size: 1.125rem; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-weight: 700; line-height: 1.3; color: #111827; }
.prose h1 { font-size: 3rem; font-weight: 800; color: var(--color-primary); line-height: 1.2; }
.prose h2 { font-size: 2rem; margin: 3rem 0 1.5rem 0; padding-bottom: 0.5em; border-bottom: 1px solid var(--color-border);}
.prose h3 { font-size: 1.5rem; margin: 2.5rem 0 1rem 0; }
.prose p { margin: 1.5rem 0; }
.prose a { color: var(--color-primary); text-decoration: underline; font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose ul, .prose ol { margin: 1.25rem 0; padding-left: 1.5rem; }
.prose li > p { margin: 0.5rem 0; }
.prose strong { font-weight: 600; color: #111827; }
.prose code { background-color: var(--color-primary-light); color: var(--color-primary-text); padding: 0.2em 0.4em; border-radius: 4px; font-size: 0.9em; font-family: var(--font-mono); }
.prose pre { background-color: var(--color-code-bg); color: var(--color-code-text); padding: 1rem; border-radius: 8px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.9em; line-height: 1.5; }
.prose pre code { background-color: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1em; border-left: 4px solid var(--color-border); font-style: italic; color: #475569; }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 2rem 0; }
.prose th, .prose td { border: 1px solid var(--color-border); padding: 0.75rem 1rem; text-align: left; }
.prose th { font-weight: 600; background-color: #f1f5f9; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; margin: 2rem 0; }
.prose mark { background-color: var(--color-highlight); padding: 0.1em 0.2em; border-radius: 3px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--color-border); }
.page-title { margin: 0; font-size: 2.25rem; font-weight: 800; line-height: 1.2; }
.page-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.page-actions button { background-color: #fff; border: 1px solid #cbd5e1; border-radius: 0.5rem; padding: 0.5rem 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.page-actions button:hover { background-color: #f1f5f9; border-color: #94a3b8; }
#save-button { background-color: var(--color-primary); color: white; border-color: var(--color-primary); }
#save-button:hover { background-color: #16a34a; }
.prose[contenteditable="true"] { outline: 2px dashed var(--color-primary); padding: 1rem; border-radius: 8px; background: var(--color-primary-light); -webkit-user-select: text; user-select: text; }
.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.5); z-index: 40; display: none; }
.overlay.open { display: block; }

/* Callout Styles */
.bq-callout {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left-width: 4px;
    border-radius: 0.25rem;
    font-style: normal;
}
.bq-callout p:first-of-type { margin-top: 0; }
.bq-callout p:last-of-type { margin-bottom: 0; }
.bq-callout strong:first-child {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.bq-tip {
    background-color: var(--color-tip-bg);
    border-left-color: var(--color-tip-border);
    color: var(--color-primary-text);
}
.bq-important {
    background-color: var(--color-important-bg);
    border-left-color: var(--color-important-border);
    color: #1e40af;
}
.bq-warning {
    background-color: var(--color-warning-bg);
    border-left-color: var(--color-warning-border);
    color: #92400e;
}

@media (max-width: 768px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.3s ease-in-out; z-index: 50; width: 280px; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 15px rgba(0,0,0,0.1); }
    .main-content { padding: 5rem 1.5rem 2rem 1.5rem; }
    .hamburger { display: block; }
    .page-header { flex-direction: column; gap: 1rem; align-items: stretch;}
}
