:root, [data-theme="light"] {
    --file-hover-bg: #f0f5ff;
}

[data-theme="dark"] {
    --file-hover-bg: #151a24;
}

/* ── Notes container ── */
#notesContainer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Section card ── */
.section-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
    animation: fadeUp 0.4s calc(var(--delay, 0s)) cubic-bezier(.22,.68,0,1.1) both;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.25s;
}

.section-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 4px 18px var(--card-hover-shadow);
}

/* ── Section header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    gap: 12px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.section-icon {
    color: var(--blue);
    font-size: 1rem;
    flex-shrink: 0;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-count {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* ── File list ── */
.file-list {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.28s cubic-bezier(.22,.68,0,1.1),
                opacity 0.22s ease;
    opacity: 1;
}

.file-list.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}

.file-list-inner {
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.file-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 24px;
    text-decoration: none;
    color: var(--p-color);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
}

.file-entry:last-child { border-bottom: none; }

.file-entry:hover {
    background: var(--file-hover-bg);
    color: var(--blue);
}

.file-entry:hover .file-dl-icon { color: var(--blue); }

.file-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-pdf-icon {
    font-size: 0.9rem;
    color: var(--muted);
    flex-shrink: 0;
}

.file-name {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-dl-icon {
    font-size: 0.8rem;
    color: var(--muted);
    flex-shrink: 0;
    transition: color 0.15s;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ── Page note ── */
.page-note {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.03em;
    opacity: 0.7;
    text-align: center;
    padding: 8px 0 24px;
}
