:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #4b5563;
    --border: #d1d5db;
    --link: #0b57d0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-family: "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
}

a {
    color: var(--link);
}

.layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    padding: 16px;
    overflow: auto;
    border-right: 1px solid var(--border);
    background: var(--panel);
}

.brand {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    text-decoration: none;
}

.search-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.search-results {
    display: grid;
    margin: 10px 0 14px;
    padding: 0;
    gap: 6px;
    list-style: none;
}

.search-result-link {
    display: block;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
}

.search-result-title {
    display: block;
    color: var(--text);
    font-weight: 700;
}

.search-result-meta {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.search-result-snippet {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.search-results-empty {
    padding: 2px 4px;
    color: var(--muted);
    font-size: 0.88rem;
}

.nav {
    display: grid;
    gap: 2px;
}

.nav a {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.nav a:hover {
    background: #eef3ff;
}

.nav a.active {
    background: #dfeaff;
    font-weight: 700;
}

.nav a.sub-link {
    padding-left: 22px;
    color: var(--muted);
    font-size: 0.93rem;
}

.nav-section {
    display: grid;
    gap: 2px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    user-select: none;
}

.nav-section-title::-webkit-details-marker {
    display: none;
}

.nav-section-title::before {
    content: '›';
    flex-shrink: 0;
    width: 1em;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--muted);
    transition: transform 0.15s ease;
    transform: rotate(0deg);
    display: inline-block;
}

.nav-section[open] > .nav-section-title::before {
    transform: rotate(90deg);
}

.nav-section-title:hover {
    background: #eef3ff;
}

.nav-section-title.active {
    color: var(--link);
}

.content {
    padding: 20px 28px;
}

.article {
    max-width: 980px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.meta {
    margin-top: -4px;
    color: var(--muted);
    font-size: 0.92rem;
}

.case-summary {
    display: grid;
    margin: 0 0 1.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.case-field {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    border-bottom: 1px solid var(--border);
}

.case-field:last-child {
    border-bottom: none;
}

.case-field dt {
    margin: 0;
    padding: 5px 10px;
    background: #eef3ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
}

.case-field dd {
    margin: 0;
    padding: 5px 10px;
    font-size: 0.94rem;
    line-height: 1.45;
    border-left: 1px solid var(--border);
}

.article img,
.article svg,
.article video,
.article table {
    max-width: 100%;
    height: auto;
}

.article table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.article th,
.article td {
    padding: 6px 8px;
    border: 1px solid var(--border);
}

@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .content {
        padding: 14px;
    }
}
