:root {
    --primary-color: #2c3e50;
    --text-color: #333;
    --bg-color: #f3f4f6;
    --container-bg: #ffffff;
    --border-color: #e9ecef;
    --accent-color: #3498db;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.2;
    margin: 0;
    padding: 50px 20px;
}

.pdf-container {
    max-width: 1200px;
    margin: 0 auto;
}

.pdf-container {
    background: white;
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(100%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    white-space: nowrap;
}

.toc-list,
.toc-list ol {
    list-style-type: none;
}

.toc-list {
    padding: 0;
}

.toc-list ol {
    padding-inline-start: 2ch;
}

.toc-list>li>a {
    font-weight: bold;
    margin-block-start: 1em;
}

.toc-list li>a {
    text-decoration: none;
    display: grid;
    grid-template-columns: auto max-content;
    align-items: end;
}

.toc-list li>a>.title {
    position: relative;
    overflow: hidden;
}

.toc-list>li>a {
    border-bottom: dotted 2px black;
}

.toc-list li>a>.toc-page {
    min-width: 2ch;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.toc-sublist li {
    line-height: 1em;
    margin: .5em;
}

.toc-sublist {
    list-style-type: disc;
    margin: 10px;
    padding-inline-start: 0%;
}

.chart-container {
    margin: 30px auto;
    max-width: 900px;
    padding: 25px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    height: 450px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    margin-top: 1.6em;
    margin-bottom: 0.8em;
    font-weight: 700;
}

h1 {
    font-size: 2.4em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

h2 {
    font-size: 40px;
}

h3 {
    font-size: 28px;
}

p {
    margin-bottom: 1.3em;
    font-size: 20px;
    line-height: 1.5em;
}

ul,
ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

li {
    margin-bottom: 0.6em;
}

li.indent {
    text-indent: -36px;
    padding-left: 36px;
}

.indent > a {
    display: inline;
}

.biblio {
    list-style-type: none;
    font-size: 12px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 25px 0;
}

table {
    width: auto;
    max-width: 100%;
    min-width: 300px;
    border-collapse: collapse;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
}

th {
    background-color: #f8f9fa;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    position: static;
    top: 0;
    z-index: 10;
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background-color: #fdfdfd;
}

tr:hover {
    background-color: #f1f4f9;
}

blockquote p::before {
    content: "\201C";
}

blockquote p::after {
    content: "\201D";
}

.blockquoteless p::before,
.blockquoteless p::after {
    content: "";
}

.quote-box {
    border: solid 3px black;
    padding: 5px;
    text-align: center;
    text-wrap: balance;
}

.page {
    background: white;
    min-height: 1000px;
    margin: 0 auto 40px auto;
    padding: 70px 90px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    width: 100%;
    page-break-after: always;
    z-index: 0;
}

.page::after {
    content: "Page " attr(data-page-num);
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 0.8em;
    color: #999;
    font-weight: 500;
}

/* High Fidelity Presentation Mode */
@media screen and (max-width: 800px) {
    .page {
        padding: 40px;
    }
}

/* Nested Table Styles */
td table {
    margin: 15px 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    background-color: #ffffff;
}

td td {
    padding: 10px 14px;
    font-size: 0.95em;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 40px auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

figcapton {
    font-size: 13px;
}

.image-container {
    text-align: center;
    margin: 30px 0;
}

.caption {
    font-size: 0.8em;
    color: #636e72;
    margin-top: 8px;
    font-style: italic;
}

body {
    margin: 0;
    padding: 0;
}

span[style*="color"] {
    font-weight: inherit;
}

.logo {
    padding: 10px;
    background-color: white;
    max-width: 150px;
}

.logo-alt {
    padding: 10px;
    background-color: white;
    max-width: 220px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex: 1;
}

.logo-column {
    display: inline-flex;
    gap: 5px;
}

.cover-logos {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.figure-column {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.figure-column > img {
    margin-bottom: 0;
}

.image-column {
    display: flex; 
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.flex-column {
    display: flex;
    justify-content: center;
}

@media only screen and (min-width: 400px) {
    .flex-column {
        flex-wrap: wrap;
    }
}

/* --- Print Optimization --- */
@media print {
    @page {
        margin: 1.5cm;
    }

    body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .page,
    .pdf-container,
    article {
        box-shadow: none !important;
        border: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 2rem !important;
        max-width: none !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    table,
    tr,
    img,
    li {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    a {
        text-decoration: none !important;
        color: black !important;
    }

    /* Avoid orphans/widows */
    p,
    li {
        orphans: 3;
        widows: 3;
    }

    /* Ensure full width and reset web-specific heights */
    .page {
        width: 100% !important;
        max-width: none !important;
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 0 2rem 0 !important;
        border: none !important;
        display: block !important;
        height: auto !important;
    }
}