body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f4faf6;
    color: #1a3d2f;
    transition: background-color 0.3s, color 0.3s;
}

body, p, li, td, th, input, label, span, div, ul, ol {
    color: #2d3a2e;
}

header {
    background: #ffffff;
    padding: 1.5em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}
header h1 {
    font-size: 2.5em;
    font-weight: bold;
    color: #218c5b;
    margin: 0;
}
header p {
    font-size: 1.2em;
    color: #555555;
    margin: 0.5em 0 0;
}

section {
    background: #f8fff9;
    margin: 2em auto;
    padding: 2em;
    max-width: 900px;
    box-shadow: 0 2px 10px rgba(33,140,91,0.07);
    border-radius: 14px;
}

h2 {
    border-bottom: 2px solid #b6e2c6;
    padding-bottom: 0.4em;
    margin-top: 0;
    color: #218c5b;
}

a {
    color: #218c5b;
    text-decoration: none;
}

a:hover {
    color: #145c39;
    text-decoration: underline;
}

/* Light mode footer text fix */
footer {
    background: #22543d; /* keep or modify your dark green shade */
    color: #ffffff; /* force bright white text */
    text-align: center;
    padding: 1em;
    margin-top: 4em;
}
footer p {
    margin: 0;
    color: #ffffff; /* force bright white text */
}
footer a {
    color: #ffffff; /* force bright white text */
}
ul {
    padding-left: 1.2em;
}

.toggle-btn {
    position: absolute;
    top: 1.5em;
    right: 2em;
    background: rgba(33,140,91,0.15);
    border: none;
    padding: 0.5em 1.2em;
    border-radius: 18px;
    cursor: pointer;
    font-size: 1.1em;
    color: #145c39; /* Always dark green for best contrast */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    z-index: 10;
    outline: none;
    font-weight: 500;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.toggle-btn:hover, .toggle-btn:focus {
    background: rgba(33,140,91,0.25);
    color: #145c39;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    background: #e6f9ee;
    border-bottom: 1px solid #b6e2c6;
    margin-bottom: 2em;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    background: none;
    border: none;
    outline: none;
    padding: 1em 2em;
    font-size: 1.1em;
    color: #218c5b;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active, .tab-btn:focus {
    background: #b6e2c6;
    color: #145c39;
    border-bottom: 3px solid #218c5b;
}

/* Styled Table */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.05em;
    background: #f8fff9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(33,140,91,0.07);
    margin-bottom: 1em;
    transition: box-shadow 0.2s;
}
.styled-table thead {
    background: #b6e2c6;
    color: #145c39;
}
.styled-table th, .styled-table td {
    padding: 0.85em 1em;
    text-align: left;
}
.styled-table tbody tr {
    border-bottom: 1px solid #e6f9ee;
    transition: background 0.2s;
}
.styled-table tbody tr:nth-child(even) {
    background: #e6f9ee;
}
.styled-table tbody tr:hover {
    background: #b6e2c6;
    color: #145c39;
    cursor: pointer;
}
.styled-table a {
    color: #218c5b;
    text-decoration: underline;
    font-weight: 500;
}
.styled-table a:hover {
    color: #145c39;
}

/* Author Toggle Button */
.author-toggle-btn {
    background: linear-gradient(90deg, #7be495 0%, #218c5b 100%);
    color: #145c39;
    border: none;
    border-radius: 18px;
    padding: 0.6em 1.5em;
    font-size: 1.05em;
    font-weight: 500;
    margin: 0 0 1.2em 0;
    box-shadow: 0 2px 8px rgba(33,140,91,0.10);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}
.author-toggle-btn:hover, .author-toggle-btn:focus {
    background: linear-gradient(90deg, #218c5b 0%, #7be495 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(33,140,91,0.18);
    transform: translateY(-2px) scale(1.03);
}

/* Chart Dropdown */
.chart-dropdown {
    background: #e6f9ee url('data:image/svg+xml;utf8,<svg fill="%23218c5b" height="22" viewBox="0 0 20 20" width="22" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 7.293a1 1 0 011.414 0L10 8.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 1em center/1.5em 1.5em;
    color: #145c39;
    border: 1.5px solid #b6e2c6;
    border-radius: 12px;
    padding: 0.5em 1.2em;
    padding-right: 3em;
    font-size: 1.05em;
    font-weight: 500;
    margin-bottom: 1.2em;
    margin-top: 0.5em;
    box-shadow: 0 2px 8px rgba(33,140,91,0.08);
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    cursor: pointer;
    appearance: none;
}
.chart-dropdown:focus, .chart-dropdown:hover {
    border-color: #218c5b;
    box-shadow: 0 4px 16px rgba(33,140,91,0.15);
}
.chart-dropdown option {
    background: #f8fff9;
    color: #145c39;
}

/* Summary Section */
.summary-card {
    background: #f8fff9;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(33,140,91,0.08);
    padding: 2.5em 2em 2em 2em;
    margin-bottom: 2.5em;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.summary-block {
    margin-bottom: 2.2em;
}
.summary-lead {
    font-size: 1.13em;
    font-weight: 600;
    margin-bottom: 0.7em;
    color: #218c5b;
}
.summary-list {
    list-style: disc inside;
    margin: 0 0 0 0.5em;
    padding: 0;
    line-height: 1.7;
    font-size: 1.07em;
    font-weight: 400;
}
.summary-list li {
    margin-bottom: 0.7em;
    padding-left: 0.2em;
}
@media (max-width: 600px) {
    .summary-card {
        padding: 1.2em 0.5em;
    }
    .summary-lead {
        font-size: 1em;
    }
    .summary-list {
        font-size: 1em;
    }
}

/* Tab Content */
.tab-content {
    background: #f8fff9;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(33,140,91,0.08);
    padding: 2.5em 2em 2em 2em;
    margin-bottom: 2.5em;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.tab-content h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 0.7em;
    color: #218c5b;
}
.tab-content p {
    font-size: 1.07em;
    line-height: 1.7;
    margin-bottom: 1.5em;
    color: #333333;
}
.tab-content ul {
    list-style: disc inside;
    margin: 0 0 0 0.5em;
    padding: 0;
    line-height: 1.7;
    font-size: 1.07em;
    font-weight: 400;
}
.tab-content ul li {
    margin-bottom: 0.7em;
    padding-left: 0.2em;
}
@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }
    header p {
        font-size: 1em;
    }
    .tab-content {
        padding: 1.2em 0.5em;
    }
    .tab-content h2 {
        font-size: 1.2em;
    }
    .tab-content p, .tab-content ul {
        font-size: 1em;
    }
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a3d2f;
    color: #e6f9ee;
}

body.dark-mode, body.dark-mode p, body.dark-mode li, body.dark-mode td, body.dark-mode th, body.dark-mode input, body.dark-mode label, body.dark-mode span, body.dark-mode div, body.dark-mode ul, body.dark-mode ol {
    color: #d2f5e3;
}

body.dark-mode header {
    background: #223f2e;
    box-shadow: 0 2px 12px rgba(123,228,149,0.10);
}
body.dark-mode header h1 {
    color: #7be495;
}
body.dark-mode header p {
    color: #a8d5ba;
}

body.dark-mode section {
    background: #223f2e;
    box-shadow: 0 2px 10px rgba(33,140,91,0.18);
}

body.dark-mode h2 {
    color: #7be495;
    border-color: #2e5c44;
}

body.dark-mode a {
    color: #7be495;
}

body.dark-mode a:hover {
    color: #b6e2c6;
}

body.dark-mode footer {
    background: #145c39;
}

body.dark-mode .toggle-btn {
    background: rgba(34,62,46,0.15);
    color: #7be495;
}

body.dark-mode .toggle-btn:hover, body.dark-mode .toggle-btn:focus {
    background: rgba(123,228,149,0.10);
    color: #b6e2c6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

body.dark-mode .tab-nav {
    background: #223f2e;
    border-bottom: 1px solid #2e5c44;
}

body.dark-mode .tab-btn {
    color: #7be495;
}

body.dark-mode .tab-btn.active, body.dark-mode .tab-btn:focus {
    background: #2e5c44;
    color: #b6e2c6;
    border-bottom: 3px solid #7be495;
}

body.dark-mode .styled-table {
    background: #223f2e;
    box-shadow: 0 2px 8px rgba(33,140,91,0.18);
}
body.dark-mode .styled-table thead {
    background: #2e5c44;
    color: #7be495;
}
body.dark-mode .styled-table tbody tr:nth-child(even) {
    background: #223f2e;
}
body.dark-mode .styled-table tbody tr {
    border-bottom: 1px solid #2e5c44;
}
body.dark-mode .styled-table tbody tr:hover {
    background: #145c39;
    color: #b6e2c6;
}
body.dark-mode .styled-table a {
    color: #7be495;
}
body.dark-mode .styled-table a:hover {
    color: #b6e2c6;
}

body.dark-mode .author-toggle-btn {
    background: linear-gradient(90deg, #145c39 0%, #7be495 100%);
    color: #e6f9ee;
}
body.dark-mode .author-toggle-btn:hover, body.dark-mode .author-toggle-btn:focus {
    background: linear-gradient(90deg, #7be495 0%, #145c39 100%);
    color: #145c39;
}

body.dark-mode .chart-dropdown {
    background: #223f2e url('data:image/svg+xml;utf8,<svg fill="%237be495" height="22" viewBox="0 0 20 20" width="22" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 7.293a1 1 0 011.414 0L10 8.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 1em center/1.5em 1.5em;
    color: #7be495;
    border: 1.5px solid #2e5c44;
    box-shadow: 0 2px 8px rgba(33,140,91,0.18);
}
body.dark-mode .chart-dropdown:focus, body.dark-mode .chart-dropdown:hover {
    border-color: #7be495;
    box-shadow: 0 4px 16px rgba(123,228,149,0.18);
}
body.dark-mode .chart-dropdown option {
    background: #223f2e;
    color: #7be495;
}

body.dark-mode .summary-card {
    background: #223f2e;
    box-shadow: 0 2px 12px rgba(123,228,149,0.10);
}
body.dark-mode .summary-lead {
    color: #7be495;
}

body.dark-mode .tab-content {
    background: #223f2e;
    box-shadow: 0 2px 12px rgba(123,228,149,0.10);
}
body.dark-mode .tab-content h2 {
    color: #7be495;
}
body.dark-mode .tab-content p {
    color: #d4f3e1;
}
/* DES Chart Container */
#des-plot {
    max-width: 800px;
    margin: 0 auto 2em auto;
    box-shadow: 0 2px 8px rgba(33,140,91,0.08);
    border-radius: 14px;
    background: #ffffff;
    padding: 1em;
}
body.dark-mode #des-plot {
    background: #223f2e;
    box-shadow: 0 2px 8px rgba(123,228,149,0.12);
}
