@page {
    margin: 16mm;
}

html,
body {
    color: #000000 !important;
    background: #ffffff !important;
}

body {
    font-size: 10.5pt;
    line-height: 1.55;
}

.skip-link,
nav,
#lang-toggle,
.proof-stepper-navigation,
.topo-controls,
.photo-controls {
    display: none !important;
}

.hero {
    padding: 0 0 10mm !important;
    text-align: start;
    background: #ffffff !important;
    border-bottom: 1px solid #777777 !important;
}

.hero h1,
.hero h2,
.hero p {
    max-width: none;
    margin-inline: 0;
    color: #000000 !important;
}

.hero h1,
.hero h2 {
    font-size: 20pt;
}

main,
.content-section,
.content-container,
.profile-page .content-container {
    width: auto !important;
    max-width: none !important;
    margin: 8mm 0 !important;
    padding: 0 !important;
}

.content-section {
    break-before: auto;
}

.grid-container {
    display: block;
}

.card,
.section-block,
.reference-panel,
.research-authority,
.chronology-strip,
.book-architecture,
.boundary-box,
.transcription-panel,
.verification-note,
.translation-caution,
.widget-container,
.symbol-detail,
.topo-container,
.proof-stepper-navigation,
.panel {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #777777 !important;
    box-shadow: none !important;
}

.card,
.section-block,
.reference-panel,
.widget-container,
.topo-container {
    margin: 0 0 6mm !important;
    break-inside: avoid-page;
}

.accordion {
    min-height: 0;
    margin-top: 6mm;
    padding: 0 0 2mm;
    color: #000000 !important;
    background: #ffffff !important;
    border: 0 !important;
    border-bottom: 1px solid #777777 !important;
    border-radius: 0;
    break-after: avoid-page;
    font-size: 13pt;
}

.accordion::after {
    display: none;
}

.panel,
.panel[hidden] {
    display: block !important;
    padding: 2mm 0 4mm;
    overflow: visible;
    border: 0 !important;
}

.proof-step,
.proof-step[hidden] {
    display: block !important;
    padding-inline-start: 0 !important;
    color: #000000 !important;
    background: #ffffff !important;
    border: 0 !important;
    break-inside: avoid-page;
}

.proof-step-title,
.proof-step-title-final,
.proof-final-formula,
.research-2-page [style*="color"] {
    color: #000000 !important;
}

.proof-step-title {
    background: #ffffff !important;
    border-left: 2px solid #777777 !important;
}

.math-scroll,
.proof-lines,
.katex-display,
pre,
.table-scroll {
    max-width: none !important;
    overflow: visible !important;
    white-space: normal !important;
}

.research-table {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 8.5pt;
}

.research-table th,
.research-table td {
    padding: 2mm !important;
}

.theorem-table td:nth-child(2) {
    white-space: normal !important;
}

pre {
    white-space: pre-wrap !important;
}

.katex-display {
    font-size: 0.9em;
}

.topo-shape,
.topo-interior,
.topo-closure {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #444444 !important;
    transform: none !important;
}

#topo-shape-label,
#topo-log,
#math-fallback {
    color: #000000 !important;
}

.photo-frame {
    width: 45mm !important;
    box-shadow: none !important;
    break-inside: avoid-page;
}

.photo-container,
.pub-list li,
figure,
table {
    break-inside: avoid-page;
}

a,
a:visited {
    color: #000000 !important;
    text-decoration: underline;
}

a[target="_blank"]::after,
main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--font-ui);
    font-size: 8pt;
    font-weight: 400;
    overflow-wrap: anywhere;
}

footer {
    margin-top: 10mm;
    padding: 4mm 0 0;
    color: #000000 !important;
    background: #ffffff !important;
    border-top: 1px solid #777777;
}
