:root {
    --bg: #f6f1e8;
    --panel: #fffdf8;
    --panel-strong: #f3e7cf;
    --ink: #1e1f1b;
    --muted: #5d5b55;
    --line: #d8ccb7;
    --accent: #8c4b2f;
    --accent-dark: #6e3922;
    --shadow: 0 18px 50px rgba(72, 47, 28, 0.12);
    --sidebar-width: 300px;
    --font-ui: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-ui);
    background: radial-gradient(circle at top left, #fff7e8 0, var(--bg) 45%, #efe5d8 100%);
    color: var(--ink);
}

a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    padding: 28px 22px;
    border-right: 1px solid var(--line);
    background: rgba(255, 252, 246, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: block;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff8ec, #f3e4cb);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.brand-kicker, .hero-kicker, .overview-section {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 700;
}

.brand-title { font-size: 1.5rem; font-weight: 800; margin-top: 6px; }
.nav-sections { display: grid; gap: 18px; }
.nav-heading { font-size: 0.82rem; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.sidebar-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 22px;
}

.sidebar-search input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fffaf2;
    font: inherit;
}

.sidebar-search button {
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    background: #ead7b7;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.nav-section a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    transition: 0.2s ease;
}

.nav-section a:hover, .nav-section a.active { background: var(--panel-strong); color: var(--ink); }

.content { padding: 34px; }

.hero, .doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid rgba(140, 75, 47, 0.16);
    background: rgba(255, 252, 246, 0.85);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.hero h1, .doc-header h1 { margin: 8px 0 12px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.04; }
.hero p, .doc-header p, .overview-card p, .login-panel p { color: var(--muted); line-height: 1.6; }

.ghost-button, .login-form button, .card-link {
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 12px 18px;
    cursor: pointer;
}

.ghost-button:hover, .login-form button:hover, .card-link:hover { background: var(--accent-dark); }

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.search-summary {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 252, 246, 0.9);
    border: 1px solid var(--line);
}

.overview-card {
    padding: 22px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.overview-card h2 { margin: 10px 0 12px; }
.card-link { display: inline-block; margin-top: 10px; }

.doc-content {
    margin-top: 24px;
    padding: 34px;
    border-radius: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    line-height: 1.72;
}

.doc-content h1, .doc-content h2, .doc-content h3 { line-height: 1.14; margin-top: 1.8em; }
.doc-content h1:first-child, .doc-content h2:first-child, .doc-content h3:first-child { margin-top: 0; }
.doc-content code { background: #f2e7d8; padding: 0.18rem 0.42rem; border-radius: 8px; }
.doc-content pre { background: #221d1a; color: #f8f1e3; padding: 18px; border-radius: 16px; overflow-x: auto; }
.doc-content blockquote { margin: 22px 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: #fbf4e9; }

.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-shell { width: min(520px, calc(100% - 32px)); }
.login-panel { padding: 32px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-kicker { text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); font-size: 0.74rem; font-weight: 800; }
.empty-state {
    grid-column: 1 / -1;
    padding: 26px;
    border-radius: 22px;
    background: rgba(255, 252, 246, 0.9);
    border: 1px dashed var(--line);
    color: var(--muted);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.login-form { display: grid; gap: 12px; margin-top: 24px; }
.login-form input { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fffaf2; font: inherit; }
.login-note { margin-top: 16px; color: var(--accent-dark); font-weight: 600; }

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .content { padding: 18px; }
    .hero, .doc-header { flex-direction: column; }
}
