body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.intro-text,
footer {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.intro-text {
    margin-bottom: 20px;
    line-height: 1.6;
    background-color: #cbe1ff;
    color: #1f2d3a;
    padding: 1px 10px 3px;
    border-radius: 4px;
    border: 1px solid rgba(59, 104, 156, 0.22);
}

.intro-text a,
footer a {
    color: #0b5ed7;
    text-decoration: none;
}

.intro-text a:hover,
footer a:hover {
    text-decoration: underline;
}

#layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

#sidebar {
    flex: 0 0 300px;
    margin-top: 50px;
}

#chart {
    flex: 1;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    justify-content: flex-end;
}

#chart .js-plotly-plot {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-left: auto;
}

#date-range {
    margin-top: 12px;
    margin-bottom: 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

#date-range label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
    color: #1f2d3a;
}

#date-range select {
    padding: 6px 8px;
    min-width: 170px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background-color: #ffffff;
    font-size: 0.9em;
}

#date-range select:focus {
    outline: none;
    border-color: #0b5ed7;
    box-shadow: 0 0 0 2px rgba(11, 94, 215, 0.25);
}

#date-range .control {
    display: flex;
    flex-direction: column;
}

.baseline-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.baseline-row select {
    width: 180px;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2d3a;
    user-select: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.75);
}

.toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}

.toggle.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#checkboxes {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
}

#checkboxes input[type="hidden"] {
    display: none;
}

:root {
    --ai-rgb: 31, 119, 180;
    --systems-rgb: 255, 127, 14;
    --theory-rgb: 44, 160, 44;
    --interdisciplinary-rgb: 148, 103, 189;
}

.theme-ai { --theme-rgb: var(--ai-rgb); }
.theme-systems { --theme-rgb: var(--systems-rgb); }
.theme-theory { --theme-rgb: var(--theory-rgb); }
.theme-interdisciplinary { --theme-rgb: var(--interdisciplinary-rgb); }

#checkboxes .parent-area-row {
    margin-top: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(var(--theme-rgb, 59, 104, 156), 0.20);
    border: 1px solid rgba(var(--theme-rgb, 59, 104, 156), 0.55);
}

#checkboxes .parent-area-label {
    font-weight: 700;
    letter-spacing: 0.2px;
    color: rgba(var(--theme-rgb, 20, 39, 58), 0.95);
}

#checkboxes .area-block {
    margin-left: 16px;
    margin-top: 3px;
    padding: 2px 0 2px 8px;
    border-left: none;
}

#checkboxes .area-block > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

#checkboxes .area-block > summary::-webkit-details-marker {
    display: none;
}

/* U+25B8 / U+25BE — Unicode escapes avoid mojibake if file encoding shifts */
#checkboxes .area-block > summary::before {
    content: "\25B8";
    width: 1em;
    flex-shrink: 0;
    display: inline-block;
    color: rgba(var(--theme-rgb, 20, 39, 58), 0.85);
    transform: translateY(-0.5px);
}

#checkboxes .area-block[open] > summary::before {
    content: "\25BE";
}

#checkboxes .area-label {
    font-weight: 600;
    color: rgba(var(--theme-rgb, 31, 45, 58), 0.95);
}

#checkboxes .conference-row {
    margin-left: 18px;
    margin-top: 1px;
    font-size: 0.92em;
    color: rgba(var(--theme-rgb, 59, 75, 92), 0.88);
}

.sidebar-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.sidebar-controls button {
    flex: 1;
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 6px;
    background: #ffffff;
    color: #1f2d3a;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.sidebar-controls button:hover {
    background: #f0f4f8;
    border-color: rgba(15, 23, 42, 0.35);
}

.sidebar-controls button:active {
    background: #e2e8f0;
}

.filter-checkbox {
    width: 14px;
    height: 14px;
    margin: 0;
    margin-right: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

#checkboxes .parent-area-row {
    display: flex;
    align-items: center;
}

#checkboxes .area-block > summary {
    display: flex;
    align-items: center;
}

#checkboxes .conference-row {
    display: flex;
    align-items: center;
}

.filter-checkbox:not(:checked) + .parent-area-label,
.filter-checkbox:not(:checked) + .area-label,
.filter-checkbox:not(:checked) + .conference-label {
    opacity: 0.5;
    text-decoration: line-through;
}

footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}
