* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Alegreya Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #2a2a2a;
    line-height: 1.7;
}

.section-panel.portrait-section-blocked {
    position: relative;
    isolation: isolate;
}

.section-panel.portrait-section-blocked > :not(.portrait-section-modal) {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}

.portrait-section-modal {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(247, 243, 235, 0.9);
    backdrop-filter: blur(6px);
}

.section-panel.portrait-section-blocked .portrait-section-modal {
    display: flex;
}

.portrait-section-modal-card {
    width: min(100%, 420px);
    padding: 2rem 1.5rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(201, 160, 99, 0.28);
    box-shadow: 0 18px 42px rgba(15, 23, 32, 0.14);
    text-align: center;
}

.portrait-section-modal-icon {
    margin-bottom: 0.9rem;
    color: #c9a063;
    font-size: 2.3rem;
    line-height: 1;
}

.portrait-section-modal-card h3 {
    margin: 0 0 0.55rem;
    color: #8a6d33;
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 600;
}

.portrait-section-modal-card p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.55;
    color: #5f5344;
}

/* Header */
header {
    background-color: #ffffff;
    padding: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

h1 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

/* Navigation Tabs */
nav {
    margin-top: 1.5rem;
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    padding: 1rem 2rem;
    background-color: transparent;
    border: none;
    color: #666666;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-family: 'Alegreya Sans', sans-serif;
}

.tab:hover {
    color: #c9a063;
    background-color: #fafafa;
}

.tab.active {
    color: #c9a063;
    border-bottom: 3px solid #c9a063;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 3rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.page-title {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: #c9a063;
    line-height: 1.2;
}

.page-description {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    line-height: 1.9;
    color: #3a3a3a;
    width: 100%;
}

p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #3a3a3a;
}

/* Feature Boxes */
.feature-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 4rem 0;
}

.feature-box {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 2.5rem;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #c9a063;
    transition: all 0.4s ease;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.feature-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(201, 160, 99, 0.25);
    border-left-color: #ddb76f;
}

.feature-box h3 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
    color: #c9a063;
}

.feature-box p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4a4a4a;
}

/* Info Sections */
.info-section {
    background-color: #ffffff;
    border-left: 5px solid #c9a063;
    padding: 2rem 2.5rem;
    margin: 3rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.info-section h3 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: #c9a063;
    margin-bottom: 1rem;
}

.info-section p {
    color: #3a3a3a;
    margin-bottom: 1rem;
}

.overview-inline-section {
    margin: 1.5rem 0;
}

.overview-inline-section h3 {
    color: #183042;
    font-family: 'Alegreya', Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 500;
    margin: 0 0 1rem;
}

.overview-inline-section p {
    color: #203444;
    margin-bottom: 1rem;
}

/* Selectors */
.selector-group {
    margin: 3rem 0;
    padding: 2.5rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #c9a063;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.selector-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.selector-col label {
    display: block;
    margin-bottom: 0.75rem;
    color: #c9a063;
    font-weight: 500;
    font-size: 1.1rem;
}

.selector-group select,
.selector-group input {
    width: 100%;
    padding: 0.9rem;
    margin-bottom: 1rem;
    background-color: #fafafa;
    border: 1px solid #d0d0d0;
    color: #2a2a2a;
    font-size: 1rem;
    font-family: 'Alegreya Sans', sans-serif;
    transition: border-color 0.3s ease;
}

.selector-group select:focus,
.selector-group input:focus {
    outline: none;
    border-color: #c9a063;
    background-color: #ffffff;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Emotion Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background-color: #f0f0f0;
    border-color: #c9a063;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: auto;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 1.08rem;
    margin: 0;
    color: #3a3a3a;
    font-weight: normal;
}

.emotion-color-box {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 0.5rem;
    border: 1px solid rgba(0,0,0,0.2);
}

.event-checkbox {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.82rem;
    background: rgba(255, 251, 242, 0.96);
    border: 1px solid rgba(201, 160, 99, 0.2);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #564a3e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.event-checkbox:hover {
    background: #f8f0df;
    border-color: rgba(201, 160, 99, 0.45);
    box-shadow: 0 6px 14px rgba(201, 160, 99, 0.12);
    transform: translateY(-1px);
}

.event-checkbox:has(input[type="checkbox"]:checked) {
    background: #f5ead1;
    border-color: rgba(201, 160, 99, 0.55);
    color: #3e3024;
}

.event-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: auto;
    margin: 0;
    accent-color: #c9a063;
}

.event-checkbox:has(input[type="checkbox"]:disabled) {
    background-color: #f3efe7;
    border-color: #e3dbcb;
    cursor: not-allowed;
    box-shadow: none;
}

.event-checkbox:has(input[type="checkbox"]:disabled):hover {
    background-color: #f3efe7;
    border-color: #e3dbcb;
    transform: none;
}

.event-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Update Button */
.update-button {
    padding: 1rem 2.5rem;
    background-color: #c9a063;
    color: white;
    border: none;
    font-size: 1.22rem;
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(201, 160, 99, 0.3);
}

.update-button:hover {
    background-color: #ddb76f;
    box-shadow: 0 4px 12px rgba(201, 160, 99, 0.4);
    transform: translateY(-2px);
}

/* Visualization Container */
#visualization-container {
    margin: 3rem 0;
    background-color: #ffffff;
    padding: 2rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    display: block;
    position: relative;
}

.dynamics-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    background: rgba(255, 252, 246, 0.92);
    backdrop-filter: blur(2px);
}

.dynamics-loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(201, 160, 99, 0.22);
    border-top-color: #c9a063;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.dynamics-loading-overlay p {
    margin: 0;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #6b5a43;
    letter-spacing: 0.01em;
}

.dynamics-chart-header {
    margin: 0 0 1rem 0;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid #ece5d8;
}

.dynamics-chart-header h3 {
    margin: 0;
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 500;
    color: #c9a063;
}

.chart-controls {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.controls-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.dynamics-events-row {
    margin-top: 1.35rem;
    padding-top: 1.3rem;
    border-top: 1px solid #e0e0e0;
}

.dynamics-events-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
}

.dynamics-events-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    width: fit-content;
    padding: 0.62rem 0.95rem;
    border: 1px solid rgba(201, 160, 99, 0.38);
    border-radius: 999px;
    background: #f8f2e6;
    color: #2d3d48;
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dynamics-events-toggle:hover {
    background: #f4e7cf;
    border-color: rgba(201, 160, 99, 0.55);
    box-shadow: 0 6px 14px rgba(201, 160, 99, 0.12);
}

.dynamics-events-toggle input[type="checkbox"] {
    margin: 0;
    accent-color: #c9a063;
}

.dynamics-events-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.dynamics-events-panel:not(.is-enabled) .dynamics-events-options {
    display: none;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    font-size: 1.02rem;
    color: #3a3a3a;
}

.control-group select,
.control-group input[type="number"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 1.02rem;
    background-color: #fafafa;
    transition: border-color 0.2s ease;
}

.control-group select:hover,
.control-group input[type="number"]:hover {
    border-color: #c9a063;
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    outline: none;
    border-color: #c9a063;
    background-color: #ffffff;
}

.control-button {
    padding: 0.5rem 1rem;
    background-color: #c9a063;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.02rem;
    font-family: 'Alegreya Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-button:hover {
    background-color: #ddb76f;
    box-shadow: 0 2px 6px rgba(201, 160, 99, 0.3);
    transform: translateY(-1px);
}

.control-button:active {
    transform: translateY(0);
}

.year-range-group {
    flex: 1;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.year-range-group label {
    font-weight: 500;
    font-size: 1.02rem;
    color: #3a3a3a;
}

.year-range-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.year-label {
    font-size: 0.96rem;
    color: #666;
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.slider-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    height: 35px;
}

.slider-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    pointer-events: none;
}

.year-slider {
    position: absolute;
    width: 100%;
    height: 35px;
    top: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    z-index: 5;
}

.year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #c9a063;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(201, 160, 99, 0.4);
    transition: all 0.2s ease;
}

.year-slider::-webkit-slider-thumb:hover {
    background: #ddb76f;
    box-shadow: 0 3px 8px rgba(201, 160, 99, 0.6);
    transform: scale(1.15);
}

.year-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #c9a063;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(201, 160, 99, 0.4);
    transition: all 0.2s ease;
}

.year-slider::-moz-range-thumb:hover {
    background: #ddb76f;
    box-shadow: 0 3px 8px rgba(201, 160, 99, 0.6);
    transform: scale(1.15);
}

.year-display {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3a3a3a;
}

.year-separator {
    color: #c9a063;
}

#chart {
    min-height: 600px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    display: block;
    position: relative;
}

#chart svg {
    display: block;
    max-width: 100%;
    height: auto;
}



.integrated-legend {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.legend-item-interactive {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.legend-item-interactive:hover {
    background-color: #ffffff;
    border-color: #c9a063;
    box-shadow: 0 2px 6px rgba(201, 160, 99, 0.2);
}

.legend-item-interactive.inactive {
    opacity: 0.4;
}

.legend-color-box {
    width: 16px;
    height: 3px;
    border-radius: 1px;
}

.legend-item-interactive .legend-label {
    font-size: 1.04rem;
    color: #3a3a3a;
    font-family: 'Alegreya Sans', sans-serif;
}

/* Chart Styles */
.line {
    fill: none;
    stroke-width: 1.5;
}

.line-smoothed {
    stroke-width: 3;
}

.axis {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 13.5px;
}

.axis-label {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 15.5px;
    fill: #3a3a3a;
}

.grid line {
    stroke: #e0e0e0;
    stroke-opacity: 0.7;
    shape-rendering: crispEdges;
}

.grid path {
    stroke-width: 0;
}

.legend {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 14px;
}

.legend-item {
    cursor: pointer;
}

.legend-item:hover rect,
.legend-item:hover line {
    opacity: 0.7;
}

.tooltip {
    position: absolute;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #c9a063;
    border-radius: 4px;
    pointer-events: none;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

/* Images */
.image-container {
    margin: 3rem 0 1rem 0;
    text-align: center;
}

.image-container img {
    width: 100%;
    max-width: 900px;
    height: auto;
    border: 1px solid #ddd;
    margin-bottom: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin: 3rem 0;
}

.image-grid .image-container {
    margin: 0;
}

.figure-caption {
    background-color: #e8e8e8;
    border-left: 4px solid #c9a063;
    padding: 1.5rem 2rem;
    margin: -1rem 0 2rem 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #2a2a2a;
}

.figure-caption strong {
    color: #c9a063;
    font-weight: 600;
}

.footnote {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-top: 1.5rem;
    line-height: 1.6;
    padding: 1.5rem;
    background-color: #fafafa;
    border-left: 3px solid #ccc;
}

/* Math */
.math-block {
    background-color: #ffffff;
    padding: 2.5rem;
    margin: 2rem 0;
    text-align: center;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.math-expression {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.3rem;
    color: #2a2a2a;
    font-style: italic;
}

.math-expression .sum {
    font-size: 2rem;
    font-style: normal;
}

/* References */
.references {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #ddd;
}

.references h3 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.5rem;
    color: #c9a063;
    margin-bottom: 1.5rem;
}

.reference-item {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
    text-indent: -2rem;
    font-size: 1.2rem;
    line-height: 1.7;
    color: #3a3a3a;
}

/* About Section */
.about-section {
    margin: 3rem 0;
}

.about-section h2 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 2rem;
    color: #c9a063;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.about-section h3 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.4rem;
    color: #c9a063;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.contact-info {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border-left: 3px solid #c9a063;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-info p {
    margin: 0.3rem 0;
    font-size: 1.26rem;
}

.contact-info a {
    color: #c9a063;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #ddb76f;
    text-decoration: underline;
}

.annex-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.annex-column .about-section {
    margin-top: 0;
    margin-bottom: 0;
}

.annex-collapsible {
    margin: 0;
}

.annex-collapsible .collapsible-trigger {
    padding: 1.2rem 1.35rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.annex-collapsible .collapsible-icon {
    font-size: 1.7rem;
}

.annex-collapsible .collapsible-body {
    padding-top: 0.35rem;
}

.annex-collapsible .contact-info:last-child {
    margin-bottom: 0;
}

.annex-section-heading {
    margin: 0.2rem 0 1rem;
    color: #183042;
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.22rem;
    font-weight: 600;
}

.annex-download-card {
    padding: 1rem 1.1rem;
    background: #fffdf9;
    border: 1px solid rgba(201, 160, 99, 0.18);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(20, 33, 43, 0.05);
}

.annex-download-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.annex-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.05rem;
    border-radius: 12px;
    background: #ead7b5;
    color: #183042;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    border: 1px solid rgba(184, 143, 78, 0.35);
    box-shadow: 0 8px 20px rgba(201, 160, 99, 0.14);
    font: inherit;
    cursor: pointer;
}

.annex-download-button:hover {
    background: #d8b16b;
    color: #183042;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(201, 160, 99, 0.22);
}

.annex-download-button-disabled,
.annex-download-button-disabled:hover {
    background: #efe8db;
    color: #8f8472;
    border-color: rgba(143, 132, 114, 0.25);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
    main {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .selector-row {
        grid-template-columns: 1fr;
    }

    .artist-display {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }

    .artist-info-column {
        grid-column: 1;
        grid-row: 1;
    }

    .radar-container {
        grid-column: 1;
        grid-row: 2;
        min-height: 400px;
    }

    .emotion-legend {
        grid-column: 1;
        grid-row: 3;
    }

    .timeline-container {
        grid-row: 4;
    }

    .histogram-container {
        grid-row: 5;
    }

    .annex-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .feature-boxes {
        grid-template-columns: 1fr;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .exploration-container {
        grid-template-columns: 1fr;
    }

    #radar-chart {
        max-height: 400px;
        width: 100%;
        height: auto;
    }

    .artist-display {
        padding: 1.5rem;
    }

    .artist-summary h3 {
        font-size: 2rem;
    }

    .artist-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    main {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 2rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .header-content {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .artist-summary h3 {
        font-size: 1.5rem;
    }

    .emotion-legend-horizontal {
        gap: 1rem;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .prominent-toggle {
        justify-content: center;
    }
}

/* Exploration Styles */
.exploration-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

.search-section {
    grid-column: 1 / -1;
}

.search-box {
    position: relative;
    max-width: 500px;
}

.search-box > label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2a2a2a;
    font-size: 1.1rem;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: 'Alegreya Sans', Arial, sans-serif;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #c9a063;
    box-shadow: 0 0 0 3px rgba(201, 160, 99, 0.1);
}

.prominent-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    padding: 0.75rem 0.9rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #faf8f3;
    color: #2a2a2a;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.prominent-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.prominent-toggle-switch {
    display: inline-block;
    position: relative;
    width: 2.4rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #cfcfcf;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.prominent-toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.prominent-toggle input:checked + .prominent-toggle-switch {
    background: #c9a063;
}

.prominent-toggle input:checked + .prominent-toggle-switch::before {
    transform: translateX(1.05rem);
}

.prominent-toggle-text {
    margin-bottom: 0;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.05rem;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f5f0e8;
}

.artist-display {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.artist-info-column {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.artist-summary {
    display: flex;
    flex-direction: column;
}

.artist-summary h3 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 3rem;
    color: #c9a063;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.artist-summary p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.artist-stats {
    grid-column: unset;
    grid-row: unset;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.emotion-legend {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 1rem 0;
}

.emotion-legend-horizontal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    justify-content: center;
}

.radar-container {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #fafaf8;
    border-radius: 4px;
    padding: 1rem;
}

.artist-info h3 {
    font-family: 'Alegreya', Georgia, serif;
    font-size: 2.5rem;
    color: #c9a063;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.artist-info p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    font-weight: 600;
    color: #666;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #e8dcc8;
    color: #666;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    border: 1px solid #c9a063;
}

.stat-info:hover {
    background-color: #c9a063;
    color: white;
}

.stat-tooltip {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2a2a2a;
    color: white;
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid #c9a063;
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: none;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-info:hover .stat-tooltip {
    display: block;
}

.stat-value {
    font-size: 1.35rem;
    color: #c9a063;
    font-weight: 500;
}

.radar-container-large {
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

#radar-chart {
    width: 100%;
    display: block;
    margin: 0 auto;
}

.prominent-journey-container {
    position: relative;
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(180deg, #fcfaf4 0%, #f5efe2 100%);
    border-radius: 12px;
    border: 1px solid #e7dcc7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.prominent-journey-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.journey-density-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    width: fit-content;
    font-size: 0.98rem;
    color: #6f6456;
    cursor: pointer;
}

.prominent-journey-header h4 {
    margin: 0;
    color: #2a2a2a;
    font-size: 1.42rem;
}

.prominent-journey-subtitle {
    margin: 0;
    color: #54493d;
    font-size: 1.08rem;
    line-height: 1.45;
}

.prominent-journey-notice {
    width: fit-content;
    max-width: min(100%, 46rem);
    margin-top: 0.15rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid rgba(201, 160, 99, 0.38);
    border-radius: 10px;
    background: rgba(255, 251, 242, 0.92);
    color: #6a5842;
    font-size: 0.94rem;
    line-height: 1.45;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.journey-density-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.18rem;
    height: 1.18rem;
    border-radius: 999px;
    border: 1px solid rgba(111, 100, 86, 0.45);
    color: #6f6456;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    background: rgba(255, 255, 255, 0.7);
    cursor: help;
}

.journey-density-info::after {
    content: attr(data-tooltip);
    position: absolute;
    display: block;
    left: calc(100% + 0.55rem);
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-width: min(280px, calc(100vw - 3rem));
    padding: 0.62rem 0.72rem;
    border-radius: 10px;
    background: rgba(42, 42, 42, 0.96);
    color: #f7f3ea;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: break-word;
    box-sizing: border-box;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
    z-index: 8;
}

.journey-density-info:hover::after,
.journey-density-info:focus-visible::after {
    opacity: 1;
}

.journey-density-info:focus-visible {
    outline: 2px solid rgba(201, 160, 99, 0.65);
    outline-offset: 2px;
}

#prominent-emotion-journey {
    width: 100%;
    max-width: 1200px;
    min-height: 640px;
    display: block;
    margin: 0 auto;
}

.prominent-journey-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    background: rgba(252, 250, 244, 0.92);
    border-radius: 12px;
    z-index: 3;
    text-align: center;
    color: #6f6456;
}

.prominent-journey-loading p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 320px;
}

.prominent-journey-loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(201, 160, 99, 0.2);
    border-top-color: #c9a063;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

#radar-chart {
    width: 100%;
    max-width: 100%;
}
/* Events visualization styling */
.events-group {
    pointer-events: auto;
}

.event-shade {
    transition: opacity 0.18s ease;
}

.event-shade:hover {
    opacity: 0.2 !important;
}

.event-label {
    transition: opacity 0.18s ease, fill 0.18s ease;
    font-family: 'Alegreya', Georgia, serif;
    bottom: auto;
    text-rendering: geometricPrecision;
}

.event-label:hover {
    opacity: 1 !important;
}

/* Event Tooltip */
.event-tooltip {
    position: fixed;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.98) 0%, rgba(248, 241, 229, 0.98) 100%);
    border: 1px solid rgba(201, 160, 99, 0.5);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    max-width: 340px;
    box-shadow: 0 12px 30px rgba(46, 37, 24, 0.14);
    font-size: 1rem;
    color: #3f342b;
    line-height: 1.55;
    z-index: 2000;
    pointer-events: none;
}

.event-tooltip .tooltip-content strong {
    display: block;
    margin-bottom: 0.32rem;
    font-family: 'Alegreya', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2f2419;
}

.event-tooltip .tooltip-content span {
    display: block;
}

/* Painting Tooltip */
.painting-tooltip {
    position: fixed;
    background-color: white;
    border: 2px solid #c9a063;
    border-radius: 8px;
    padding: 1rem;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.98rem;
    color: #2a2a2a;
    z-index: 1000;
    pointer-events: none;
}

.painting-tooltip #painting-title {
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.painting-tooltip.country-theme-tooltip {
    max-width: 520px;
}

.painting-tooltip-emotion-summary {
    margin-bottom: 0.55rem;
    color: #8a7d6b;
    font-size: 0.84rem;
    font-weight: 600;
}

.painting-tooltip-radar-shell {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0 0.1rem;
}

.painting-tooltip-radar {
    display: block;
    overflow: visible;
}

.painting-tooltip-metrics {
    display: grid;
    gap: 0.22rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e6ddcf;
    font-size: 0.9rem;
    line-height: 1.45;
}

.painting-tooltip-note {
    margin-top: 0.45rem;
    color: #8f8476;
    font-size: 0.84rem;
}

.country-theme-tooltip #painting-title,
.country-theme-tooltip #dynamics-theme-title {
    font-size: 1.42rem;
    line-height: 1.35;
}

.country-theme-tooltip #painting-year,
.country-theme-tooltip #dynamics-theme-year {
    color: #7b6d59;
    font-size: 1.12rem;
}

.country-theme-tooltip #painting-emotions,
.country-theme-tooltip #dynamics-theme-body {
    font-size: 1.22rem;
    line-height: 1.78;
    color: #3a3a3a;
}

.country-theme-tooltip-label {
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    background-color: #f5efe2;
    color: #8a6d33;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.country-theme-tooltip-copy {
    white-space: pre-line;
}

.country-theme-summary-entry + .country-theme-summary-entry {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid #eee3d1;
}

.country-theme-summary-heading {
    margin-bottom: 0.3rem;
    color: #8a6d33;
    font-weight: 700;
    font-size: 1.16rem;
}

.country-theme-tooltip-hint {
    margin-top: 0.8rem;
    color: #8b7d68;
    font-size: 1.02rem;
    font-style: italic;
}

.tooltip-content {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 0.95rem;
}


.tooltip-content strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #c9a063;
    font-weight: 600;
}

.event-shade-interactive {
    cursor: pointer;
    transition: opacity 0.1s ease;
}

.journey-empty-state {
    fill: #857766;
    font-size: 14px;
}

.dynamics-theme-group-line {
    stroke: #ccb289;
    stroke-width: 2.2;
    opacity: 0.7;
}

.dynamics-theme-label-bg {
    fill: #f8f2e7;
    stroke: #dbc8a7;
    stroke-width: 1;
}

.dynamics-theme-label-text {
    fill: #8a6d33;
    font-size: clamp(13px, 1vw, 18px);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.dynamics-theme-connector {
    stroke: #baa48a;
    stroke-width: 1.2;
    stroke-dasharray: 3,3;
    opacity: 0.95;
}

.dynamics-theme-medallion-shadow {
    fill: rgba(255, 255, 255, 0.95);
    stroke: #c9a063;
    stroke-width: 2.2;
}

.dynamics-theme-medallion-image {
    stroke: #ffffff;
    stroke-width: 1.25;
}

.dynamics-theme-medallion-glow {
    fill: none;
    stroke: rgba(201, 160, 99, 0.45);
    stroke-width: 1.1;
}

.dynamics-theme-fallback {
    fill: #8c7c67;
    font-size: 14px;
    font-weight: 700;
}

/* Loading Overlay */
.wp-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    border-radius: 8px;
}

.wp-loading-spinner {
    text-align: center;
}

.wp-loading-spinner .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #c9a063;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wp-loading-spinner p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.wp-progress-bar-container {
    width: 250px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.wp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c9a063, #e8a186);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Wealth & Positivity Exploration */
.wealth-positivity-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    position: relative;
    width: 100%;
    min-width: 0;
}

.wp-filters-panel {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: minmax(220px, 0.95fr) minmax(180px, 1fr) minmax(260px, 1.35fr) auto;
    gap: 1rem 1.25rem;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

.wp-filters-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: #2a2a2a;
    border-bottom: 2px solid #c9a063;
    padding-bottom: 0.5rem;
    grid-column: 1 / -1;
}

.wp-filters-panel .filter-group,
.wp-filters-panel .control-group {
    margin-bottom: 0;
}

.wp-filters-panel > * {
    min-width: 0;
}

.wp-mode-buttons {
    grid-column: 1;
    margin: 1.85rem 0 0;
}

.wp-filters-panel #wp-country-group {
    grid-column: 2;
}

.wp-filters-panel #wp-time-period-group {
    grid-column: 3;
}

.wp-filters-panel #wp-artist-group {
    grid-column: 2 / 4;
}

.wp-filters-panel #wp-add-button {
    grid-column: 4;
    width: auto;
    min-width: 150px;
    margin-top: 1.85rem;
    justify-self: end;
    align-self: start;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.filter-group select,
.filter-group input[type="number"],
.wp-search-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #2a2a2a;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #c9a063;
    box-shadow: 0 0 0 2px rgba(201, 160, 99, 0.1);
}

.wp-search-input {
    margin-bottom: 0.5rem;
}

.filter-group select[size] {
    height: auto;
}

.wp-button-primary {
    width: 100%;
    padding: 0.8rem;
    background-color: #c9a063;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    font-family: inherit;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

.wp-button-primary:hover {
    background-color: #b8923f;
}

.wp-button-primary:disabled {
    background-color: #d3d3d3;
    color: #808080;
    cursor: not-allowed;
    opacity: 0.6;
}

.wp-button-primary:disabled:hover {
    background-color: #d3d3d3;
}

/* Mode selection buttons */
.wp-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    align-self: start;
}

.wp-mode-button {
    padding: 0.7rem;
    background-color: #f0f0f0;
    color: #666;
    border: 2px solid transparent;
    border-radius: 3px;
    font-family: inherit;
    font-size: 1.04rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wp-mode-button:hover {
    background-color: #e8e8e8;
}

.wp-mode-active {
    background-color: #c9a063;
    color: #ffffff;
    border-color: #b8923f;
}

.wp-content-area {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    width: 100%;
    min-width: 0;
}

.wp-histograms-container {
    display: contents;
}

.wp-histogram-wrapper {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    min-width: 0;
    overflow: hidden;
}

.wp-histogram-wrapper h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #2a2a2a;
    font-weight: 600;
}

.wp-histogram-wrapper svg {
    width: 100%;
    height: 400px;
    display: block;
    max-width: 100%;
}

.wp-density-curve {
    fill: none;
    stroke-width: 2;
}

.wp-density-fill {
    opacity: 0.25;
}

.wp-plot-stack {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    grid-column: 1 / -1;
    min-width: 0;
    overflow: hidden;
}

.wp-plot-stack h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #2a2a2a;
    font-weight: 600;
}

.wp-plot-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wp-empty-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.wp-plot-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background-color: #f9f9f9;
    border-left: 4px solid;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    min-width: 0;
}

.wp-plot-item:hover {
    background-color: #f0f0f0;
}

.wp-plot-label {
    font-size: 0.9rem;
    color: #2a2a2a;
    font-weight: 500;
    display: block;
}

.wp-plot-label-wrap {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wp-plot-meta {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

.wp-plot-color {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.1s ease;
}

.wp-plot-color:hover {
    transform: scale(1.1);
}

.wp-plot-delete {
    padding: 0.4rem 0.6rem;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.wp-plot-delete:hover {
    background-color: #ff5252;
}

/* Bug Report Form */
.bug-report-container {
    max-width: none;
    margin: 1.5rem 0 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
}

.bug-report-description {
    margin-bottom: 2rem;
    font-size: 1.32rem;
    color: #555;
    padding: 1rem;
    background-color: #f9f9f9;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
}

.bug-report-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #2a2a2a;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Alegreya Sans', Arial, sans-serif;
    font-size: 1.2rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-help {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

.form-label input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.bug-report-submit-btn {
    padding: 0.75rem 2rem;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bug-report-submit-btn:hover {
    background-color: #0b7dda;
}

.bug-report-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.bug-report-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    font-weight: 500;
}

.bug-report-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bug-report-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#bugReportMessage {
    margin: 0;
}

/* Editorial layout overrides */
html {
    scroll-behavior: smooth;
}

body {
    display: block;
    background:
        radial-gradient(circle at top left, rgba(201, 160, 99, 0.08), transparent 30%),
        radial-gradient(circle at top right, rgba(17, 30, 44, 0.08), transparent 24%),
        linear-gradient(180deg, #f3f1ec 0%, #eef0ee 100%);
    color: #22303a;
    overflow-x: hidden;
}

nav {
    margin-top: 0;
}

.tabs,
.section-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    border-bottom: 0;
}

.tab,
.section-nav-link {
    width: 100%;
    padding: 0.78rem 0.85rem;
    border: 1px solid rgba(23, 35, 45, 0.1);
    border-radius: 14px;
    background: rgba(248, 244, 236, 0.96);
    color: #1c2d39;
    text-align: left;
    font-size: 0.96rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: transform 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.tab:hover,
.section-nav-link:hover {
    color: #14212b;
    background: #f4e6cc;
    border-color: rgba(201, 160, 99, 0.45);
    transform: translateX(2px);
}

.tab.active,
.section-nav-link.active,
.section-nav-link[aria-current="true"] {
    color: #10202c;
    background: linear-gradient(135deg, #f0d7ab, #c9a063);
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(201, 160, 99, 0.24);
}

main {
    max-width: none;
    width: 100%;
    padding: 2rem clamp(1.5rem, 3vw, 3rem) 4rem;
}

.page-shell {
    --page-rail-width: 13.75rem;
    display: grid;
    grid-template-columns: var(--page-rail-width) minmax(0, 1fr);
    gap: 0 1.5rem;
    align-items: start;
    transition: grid-template-columns 0.22s ease;
}

.page-shell.page-shell-collapsed {
    --page-rail-width: 4.25rem;
}

.page-rail {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    padding: 0;
    min-width: 0;
}

.page-rail-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.55rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(23, 35, 45, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #233745;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.page-rail-toggle:hover {
    background: #f4e6cc;
    border-color: rgba(201, 160, 99, 0.45);
}

.page-rail-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
}

.section-nav-text {
    display: block;
}

.page-shell.page-shell-collapsed .page-rail-toggle {
    justify-content: center;
    padding-inline: 0.5rem;
}

.page-shell.page-shell-collapsed .page-rail-toggle-label,
.page-shell.page-shell-collapsed .section-nav-text {
    display: none;
}

.page-shell.page-shell-collapsed .section-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: 0.7rem 0.45rem;
    text-align: center;
}

.page-content {
    min-width: 0;
}

.section-panel,
.tab-content {
    display: block;
    margin-bottom: 1.8rem;
    padding: clamp(1.4rem, 2vw, 2.2rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 248, 244, 0.98));
    border: 1px solid rgba(201, 160, 99, 0.18);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(20, 30, 40, 0.08);
    scroll-margin-top: 1.25rem;
}

.tab-content.active {
    display: block;
}

.section-kicker {
    display: inline-block;
    margin-bottom: 0.85rem;
    color: #8d6a3b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.page-title {
    font-size: clamp(2.6rem, 5vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: #17232d;
    max-width: none;
    margin-bottom: 1.35rem;
}

.page-title-subtitle {
    display: block;
    margin-top: 0.55rem;
    font-size: clamp(1.15rem, 2vw, 1.8rem);
    line-height: 1.12;
    font-weight: 400;
    color: #8d6a3b;
    letter-spacing: 0;
}

.page-description,
p {
    max-width: none;
}

.section-panel:not(#overview) .page-title {
    font-size: clamp(1.1rem, 1.7vw, 1.45rem);
    line-height: 1.12;
    letter-spacing: 0.01em;
    margin-bottom: 0.65rem;
    color: #4b5d69;
    font-weight: 500;
}

.page-description {
    font-size: 1.44rem;
}

p {
    font-size: 1.26rem;
}

.experience-note {
    display: inline-block;
    margin: 0 0 2rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: rgba(240, 215, 171, 0.24);
    border: 1px solid rgba(201, 160, 99, 0.25);
    color: #5a4b38;
    font-size: 1.08rem;
}

.overview-intro {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.overview-grid,
.feature-boxes,
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.overview-card,
.feature-box,
.info-section,
.math-block,
.selector-group,
#visualization-container,
.contact-info {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 43, 54, 0.08);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 32, 0.08);
}

.overview-card,
.feature-box {
    padding: 1.6rem;
    border-left: 4px solid #c9a063;
}

.overview-card h3,
.feature-box h3,
.info-section h3,
.references h3,
.about-section h2 {
    color: #183042;
    font-family: 'Alegreya', Georgia, serif;
}

.info-section,
.math-block,
.selector-group,
#visualization-container,
.contact-info {
    padding: clamp(1.2rem, 2vw, 2rem);
    margin: 1.5rem 0;
}

.section-card {
    padding: clamp(1.2rem, 2vw, 2rem);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(201, 160, 99, 0.18);
    box-shadow: 0 10px 28px rgba(15, 23, 32, 0.06);
}

.collapsible {
    border: 1px solid rgba(201, 160, 99, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 24px rgba(15, 23, 32, 0.06);
    overflow: hidden;
}

.collapsible-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.2rem;
    background: transparent;
    border: 0;
    color: #17232d;
    font: inherit;
    font-size: 1.16rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.collapsible-body {
    padding: 0 1.2rem 1.2rem;
    color: #2d3b46;
    height: auto;
    overflow: hidden;
    opacity: 1;
    will-change: height, opacity;
}

.collapsible-icon {
    margin-left: 1rem;
    font-size: 1.3rem;
    line-height: 1;
    color: #8d6a3b;
}

.collapsible:not(.is-open) .collapsible-body {
    opacity: 0;
}

.is-open {
    border-color: rgba(201, 160, 99, 0.4);
}

.overview-grid {
    margin-top: 1.5rem;
}

.overview-intro p,
.overview-card p,
.feature-box p {
    color: #31424f;
}

.feature-box:hover,
.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(15, 23, 32, 0.1);
}

.section-panel .page-title + .page-description {
    margin-top: 0;
}

.section-panel > *:last-child,
.tab-content > *:last-child {
    margin-bottom: 0;
}

.section-nav-link {
    display: block;
    text-decoration: none;
}

.section-nav-link:focus-visible,
.tab:focus-visible,
.collapsible-trigger:focus-visible,
.page-rail-toggle:focus-visible {
    outline: 2px solid #f0d7ab;
    outline-offset: 2px;
}

.overview-intro,
.overview-card,
.section-card {
    animation: fadeIn 0.45s ease both;
}

@media (max-width: 1420px) {
    .wp-filters-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wp-mode-buttons {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .wp-filters-panel #wp-country-group,
    .wp-filters-panel #wp-time-period-group,
    .wp-filters-panel #wp-artist-group {
        grid-column: span 2;
    }

    .wp-filters-panel #wp-add-button {
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
        margin-top: 0;
    }
}

@media (max-width: 1280px) {
    .wp-content-area {
        grid-template-columns: 1fr;
    }

    .page-description {
        font-size: 1.24rem;
    }

    p {
        font-size: 1.12rem;
    }

    #visualization-container,
    .info-section,
    .math-block,
    .selector-group,
    .contact-info,
    .section-card {
        padding: 1.35rem;
    }

    .integrated-legend {
        gap: 1rem;
    }

    .legend-item-interactive .legend-label {
        font-size: 0.96rem;
    }
}

@media (max-width: 1100px) {
    .tabs,
    .section-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .tab,
    .section-nav-link {
        width: auto;
        white-space: nowrap;
    }

    .page-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-rail {
        position: static;
        min-height: auto;
        padding: 0;
    }

    .page-rail-toggle {
        display: none;
    }

    main {
        padding: 1.4rem 1rem 3rem;
    }

    .page-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-rail {
        position: static;
    }

    .wp-filters-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wp-mode-buttons {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .wp-filters-panel #wp-country-group,
    .wp-filters-panel #wp-time-period-group,
    .wp-filters-panel #wp-artist-group {
        grid-column: span 2;
    }

    .wp-filters-panel #wp-add-button {
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
        margin-top: 0;
    }

    #chart {
        min-height: 540px;
    }

    .axis {
        font-size: 11px;
    }

    .axis-label {
        font-size: 13px;
    }

    .dynamics-chart-header h3 {
        font-size: 1.55rem;
    }
}

@media (max-width: 720px) {
    .page-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .tab,
    .section-nav-link {
        padding: 0.85rem 0.95rem;
        font-size: 1rem;
    }

    .section-panel,
    .tab-content {
        padding: 1rem;
        border-radius: 18px;
    }

    .overview-grid,
    .feature-boxes,
    .image-grid {
        grid-template-columns: 1fr;
    }

    .annex-download-actions {
        align-items: stretch;
    }

    .annex-download-button {
        width: 100%;
    }

    .wp-content-area,
    .wp-filters-panel {
        grid-template-columns: 1fr;
    }

    .wp-filters-panel #wp-artist-group,
    .wp-filters-panel #wp-time-period-group,
    .wp-filters-panel #wp-country-group,
    .wp-mode-buttons,
    .wp-filters-panel #wp-add-button {
        grid-column: auto;
    }

    .wp-mode-buttons,
    .wp-filters-panel #wp-add-button {
        margin-top: 0;
    }

    .page-description {
        font-size: 1.06rem;
    }

    p {
        font-size: 1rem;
    }

    #chart {
        min-height: 460px;
    }

    .integrated-legend {
        gap: 0.75rem;
    }

    .legend-item-interactive {
        padding: 0.4rem 0.75rem;
    }

    .legend-item-interactive .legend-label {
        font-size: 0.88rem;
    }

    .dynamics-chart-header h3 {
        font-size: 1.28rem;
    }
}
