:root {
    --bg-main: #0f172a; --bg-sidebar: #1e293b; --bg-editor: #0b0f19;
    --border-color: #334155; --text-main: #f8fafc; --text-muted: #94a3b8;
    --accent: #3b82f6; --danger: #ef4444; --success: #10b981;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; overflow-x: hidden; }

/* Global Header */
header { background-color: rgba(30, 41, 59, 0.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; height: 60px; position: sticky; top: 0; z-index: 1000; flex-shrink: 0; }
.logo-area { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: white; outline: none; }
.logo-area:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* Navbar Buttons */
.header-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Global Buttons */
.btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); padding: 0.4rem 0.8rem 0.4rem 0.6rem; border-radius: 0.375rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 500; transition: all 0.2s; outline: none; }
.btn:hover { background-color: var(--border-color); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background-color: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background-color: #2563eb; }
.btn-danger { color: #fca5a5; border-color: #7f1d1d; }
.btn-danger:hover { background-color: #7f1d1d; color: white; }

.icon-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 0.35rem; border-radius: 0.375rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; outline: none; min-width: 32px; min-height: 32px; }
.icon-btn:hover, .icon-btn.active { color: var(--text-main); background-color: var(--border-color); }
.icon-btn.active { color: var(--accent); border-color: var(--border-color); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Global Utilities */
.show-mobile { display: none; }
@media (max-width: 500px) {
    .hide-mobile { display: none; }
    .show-mobile { display: inline; }
}

/* Main Site Footer */
footer { background-color: var(--bg-sidebar); border-top: 1px solid var(--border-color); padding: 2.5rem 2rem 1.5rem; margin-top: auto; color: #64748b; }
.footer-grid { max-width: 1400px; margin: 0 auto 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; text-align: left; }
.footer-col h4 { color: #fff; margin-bottom: 1rem; font-size: 1.05rem; }
.footer-col p, .footer-col a { color: var(--text-muted); font-size: 0.9rem; text-decoration: none; display: block; margin-bottom: 0.5rem; transition: color 0.2s; line-height: 1.5; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1400px; margin: 0 auto; padding-top: 1.5rem; border-top: 1px solid var(--border-color); text-align: center; color: #64748b; font-size: 0.85rem; }

/* Dedicated Library Minimal Footer */
.footer-minimal { border-top: 1px solid var(--border-color); padding: 2rem 1rem; text-align: center; color: #64748b; font-size: 0.85rem; }
.footer-minimal .logo-area { justify-content: center; margin-bottom: 0.5rem; opacity: 0.7; }