:root {
    --accent-primary: #a84c35;
    --accent-secondary: #c16b50;
    --accent-light: #f8ece6;
    --nav-width: 294px;
    --content-max-width: 1020px;
}

[data-theme="dark"] {
    --accent-primary: #ecaa91;
    --accent-secondary: #f5c1ac;
    --accent-light: #382b29;
}

html { scrollbar-gutter: stable; }
body { -webkit-font-smoothing: antialiased; }
.content { overflow-wrap: anywhere; }
.main { padding-top: 64px; }
.filing-monogram { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--accent-primary); font: 700 29px/1 Georgia, serif; }
.header-logo { font-size: 16px; }
.header-actions button, .home-btn { min-width: 38px; min-height: 38px; justify-content: center; }
.home-btn { font-size: 23px; line-height: 1; }
.theme-toggle { font-size: 20px; }
.menu-toggle { font-size: 20px; }
.focus-toggle { border: 1px solid var(--accent-primary); border-radius: 6px; background: var(--bg-primary); color: var(--accent-primary); padding: 8px 12px; white-space: nowrap; font-size: 13px; font-weight: 600; cursor: pointer; }
.focus-toggle[aria-pressed="true"] { background: var(--accent-light); }
.focus-note { margin: 24px 0; padding: 18px 22px; border-left: 3px solid var(--accent-primary); background: var(--accent-light); border-radius: 4px; font-size: 14px; line-height: 1.85; }
.focus-note strong { color: var(--accent-primary); }
.focus-note p { margin: 6px 0 0; }
[hidden] { display: none !important; }
.focus-reading .source-comparison, .focus-reading .original-image, .focus-reading .image-transcript,
.focus-reading .unit-links, .focus-reading .reading-note, .focus-reading .footer { display: none; }
.filing-eyebrow { font: 600 12px/1.6 Inter, sans-serif; letter-spacing: .13em; color: var(--accent-primary); margin-bottom: 22px; }
.content > h1 { font: 600 clamp(2.8rem, 5vw, 4rem)/1.16 Georgia, 'Noto Sans SC', serif; letter-spacing: -.025em; margin-bottom: 22px; }
.content > h1 span { display: block; font: 500 .62em/1.35 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif; margin-top: 10px; letter-spacing: -.015em; }
.article-title-en { font-size: 15px; font-style: normal; max-width: 700px; }
.filing-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0; color: var(--text-secondary); font-size: 13px; }
.filing-meta > span:first-child { color: var(--accent-primary); font-weight: 600; }
.source-banner { border-left: 3px solid var(--accent-primary); border-radius: 4px; align-items: flex-start; gap: 24px; }
.source-banner a { font-size: 13px; white-space: nowrap; }
.reading-note { border: 0; padding: 0; background: none; font-size: 13px; line-height: 1.85; margin: 20px 0 30px; }
.reading-note summary { color: var(--text-secondary); font-weight: 500; }
.reading-note p { margin-top: 12px; max-width: 850px; }
.nav-sidebar { padding-top: 28px; overscroll-behavior: contain; }
.nav-title { display: flex; justify-content: space-between; margin-bottom: 8px; }
.nav-title span { font-weight: 400; letter-spacing: 0; }
.reading-tools-link { display: block; padding: 8px 12px 18px; font-size: 12px; text-decoration: none; }
.nav-list { margin: 0; padding: 0; }
.nav-link { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; font-size: 12.5px; line-height: 1.7; }
.nav-link span { flex: 1; }
.nav-link small { color: var(--text-muted); font: 11px/1.7 ui-monospace, SFMono-Regular, monospace; flex-shrink: 0; }
.nav-footer { font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-color); margin: 22px 12px 0; padding-top: 18px; line-height: 1.9; }
.reading-tools { display: grid; grid-template-columns: 1fr; gap: 20px 28px; padding: 24px; margin: 36px 0 46px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-secondary); scroll-margin-top: 8px; }
.reading-tools label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.input-row { display: flex; gap: 8px; }
.input-row input, .input-row select { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 13px; }
.input-row button, #moreResults { border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-primary); color: var(--accent-primary); padding: 9px 13px; white-space: nowrap; cursor: pointer; font-size: 13px; }
.input-row button:hover, #moreResults:hover { border-color: var(--accent-primary); }
.tool-hint { margin: 8px 0 0; color: var(--text-muted); font-size: 11px; }
.search-results { grid-column: 1 / -1; border-top: 1px solid var(--border-color); padding-top: 16px; }
.search-results[hidden], #moreResults[hidden] { display: none; }
#searchStatus { font-size: 13px; }
#searchMatches { max-height: 360px; overflow: auto; padding-left: 22px; font-size: 13px; }
#searchMatches li { margin: 0 0 14px; padding-left: 2px; }
#searchMatches a { font-weight: 600; }
#searchMatches p { margin: 4px 0 0; font-size: 12px; line-height: 1.7; }
.filing-section { margin: 0; padding: 0; scroll-margin-top: 8px; }
.filing-section + .filing-section { margin-top: 40px; }
.reading-block { scroll-margin-top: 8px; }
.reading-block:focus { outline: none; }
.source-bookmark, .source-anchor { display: block; height: 0; scroll-margin-top: 8px; }
#chapter-01 .filing-heading { text-align: center; font-size: 14px; font-weight: 600; line-height: 1.6; margin: 10px 0; }
.translated-content { line-height: 1.95; }
.translated-content p.filing-paragraph { color: var(--text-primary); margin-bottom: 18px; }
.translated-content h2 { font-size: 25px; line-height: 1.5; margin: 28px 0 22px; }
.translated-content h3 { font-size: 18px; line-height: 1.75; margin: 26px 0 16px; }
.filing-paragraph { white-space: normal; }
.filing-note { font-size: 13px; line-height: 1.85; }
.bullet-paragraph { padding-left: 1.2em; text-indent: -1.2em; }
.source-anchor { display: block; scroll-margin-top: 6px; }
.filing-running { font-size: 11px; line-height: 1.5; color: var(--text-muted) !important; margin: 8px 0 15px !important; }
.filing-running.page-number { text-align: right; margin-top: 18px !important; }
.source-rule { height: 1px; border: 0; background: var(--border-color); margin: 12px 0; }
.unit-links { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: .7em; font-size: 11px; text-indent: 0; }
.table-wrapper { max-width: 100%; margin: 22px 0 26px; border: 1px solid var(--border-color); border-radius: 5px; overscroll-behavior-inline: contain; }
.table-wrapper table { border-collapse: collapse; width: 100%; margin: 0; font-size: 12px; line-height: 1.65; }
.table-wrapper.wide-table table { min-width: 850px; }
.wide-table .filing-cell:not(.numeric-cell):not(.empty-cell) { min-width: 7em; }
.table-wrapper.wide-table td:first-child:not(.numeric-cell) { min-width: 180px; }
.filing-cell { padding: 8px 9px; border: 0; border-bottom: 1px solid var(--border-color); vertical-align: top; color: var(--text-primary); }
.filing-cell + .filing-cell { border-left: 1px solid var(--border-color); }
.table-wrapper tbody:last-child tr:last-child .filing-cell { border-bottom: 0; }
.table-period th { padding: 14px 9px; background: var(--accent-light); color: var(--accent-primary); text-align: left; border-top: 1px solid var(--border-color); }
.table-wrapper tr:nth-child(even) { background: var(--bg-secondary); }
.numeric-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-cell { padding-top: 3px; padding-bottom: 3px; }
.table-wrapper td:first-child:not(.numeric-cell) { min-width: 120px; }
.source-comparison { margin: 24px 0 0; border-radius: 5px; padding: 12px 16px; }
.source-comparison > summary, .original-image > summary, .image-transcript > summary { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.english-content { padding-top: 10px; font: 14px/1.85 Georgia, 'Times New Roman', serif; overflow-wrap: anywhere; }
.english-content h2, .english-content h3 { font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 16px; margin: 20px 0 12px; }
.english-content .filing-paragraph { margin-bottom: 16px; }
.english-content .table-wrapper table { font-size: 12px; }
.filing-figure { margin: 20px 0; }
#chapter-02 .filing-figure { margin: 0; }
#chapter-02 .filing-figure > figcaption { display: none; }
.filing-figure > figcaption { font-size: 19px; line-height: 1.6; font-weight: 600; margin-bottom: 18px; }
.image-translation { padding: 0; }
.image-translation p { color: var(--text-primary); line-height: 1.95; }
.image-translation h2, .image-translation h3, .image-translation h4 { font-size: 17px; }
.image-translation table { display: block; overflow-x: auto; max-width: 100%; }
.filing-image { display: block; max-width: 100%; width: 100%; height: auto; object-fit: contain; background: #fff; margin-top: 12px; }
.original-image, .image-transcript { border-radius: 5px; margin: 18px 0 0; }
.image-transcript > div { font: 13px/1.8 Georgia, serif; }
.image-source { display: block; text-align: right; margin-top: 10px; font-size: 11px; }
.footer { margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border-color); font-size: 13px; }
.back-to-top { font-size: 24px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 3000; padding: 12px 18px; background: var(--bg-primary); border: 2px solid var(--accent-primary); color: var(--accent-primary); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.draft-banner { position: sticky; top: 70px; z-index: 30; background: #fff1b7; color: #693c00; border: 2px solid #a96700; padding: 14px 18px; margin-bottom: 30px; font-weight: 700; font-size: 14px; }
.untranslated { background: #fff2c7; color: #693c00; }

@media (max-width: 1100px) {
    :root { --nav-width: 260px; }
    .main { padding-left: 22px; padding-right: 22px; }
    .reading-tools { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    .main { padding: 36px 18px; margin-left: 0; }
    .header { padding: 0 12px; }
    .header-actions { gap: 6px; }
    .header-logo { gap: 5px; font-size: 14px; }
    .filing-monogram { width: 24px; font-size: 26px; }
    .header-actions button, .home-btn { min-width: 34px; min-height: 34px; padding: 5px 8px; }
    .content > h1 { font-size: 43px; }
    .article-title-en { font-size: 13px; }
    .reading-tools { margin-top: 24px; padding: 18px; }
    .translated-content { font-size: 15px; line-height: 1.95; }
    .translated-content h2 { font-size: 23px; }
    .source-banner { gap: 10px; }
    .table-wrapper table { min-width: 480px; }
    .table-wrapper.wide-table table { min-width: 800px; }
    .source-comparison { padding: 12px; }
    .english-content { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}

@media (max-width: 600px) {
    .header-logo .short-title, .header-logo .full-title { display: none; }
    .header-actions .focus-toggle { padding: 7px 10px; }
    .focus-note { padding: 14px 16px; font-size: 13px; }
}

@media print {
    .header, .nav-sidebar, .back-to-top, .progress-bar, .skip-link, .reading-tools, .source-comparison, .original-image, .image-transcript { display: none !important; }
    .main { margin: 0; padding: 0; }
    .content { max-width: none; }
    .table-wrapper { overflow: visible; }
    .table-wrapper table, .table-wrapper.wide-table table { min-width: 0; font-size: 8px; }
    .wide-table .filing-cell:not(.numeric-cell):not(.empty-cell), .table-wrapper.wide-table td:first-child:not(.numeric-cell) { min-width: 0; }
    .filing-cell { padding: 3px; }
    .filing-heading, figcaption { break-after: avoid; }
    tr { break-inside: avoid; }
    a { color: inherit; }
}
