:root {
  --paper: #f5f1e7;
  --paper-deep: #ece7da;
  --white: #fffdf8;
  --ink: #25342b;
  --forest: #294235;
  --green: #637d4c;
  --moss: #879978;
  --jade: #e7eee4;
  --line: #d7ddd1;
  --muted: #6c786f;
  --ochre: #a3824d;
  --serif: "Songti SC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "FangSong", "STFangsong", "Noto Serif CJK SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.grain { background-image: repeating-linear-gradient(0deg, rgba(42, 66, 53, .018) 0, rgba(42, 66, 53, .018) 1px, transparent 1px, transparent 4px); inset: 0; pointer-events: none; position: fixed; z-index: 90; }

.topbar { align-items: center; backdrop-filter: blur(14px); background: rgba(245, 241, 231, .95); border-bottom: 1px solid var(--line); display: flex; height: 72px; inset: 0 0 auto; justify-content: space-between; padding: 0 28px; position: fixed; z-index: 30; }
.brand { align-items: center; background: none; border: 0; display: flex; gap: 13px; padding: 0; text-align: left; }
.brand b, .brand small { display: block; }
.brand b { font-family: var(--serif); font-size: 16px; letter-spacing: .1em; }
.brand small { color: var(--muted); font-size: 8px; letter-spacing: .27em; margin-top: 4px; }
.leaf-mark { background: var(--green); border-radius: 92% 8% 84% 16%; display: block; height: 25px; position: relative; transform: rotate(-36deg); width: 17px; }
.leaf-mark::after { background: var(--forest); content: ""; height: 18px; left: 8px; position: absolute; top: 13px; transform: rotate(36deg); width: 1px; }
.top-actions { align-items: center; display: flex; gap: 18px; }
.private-mark { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.outline-button { background: transparent; border: 1px solid var(--green); border-radius: 2px; color: var(--forest); font-size: 12px; padding: 9px 15px; }
.outline-button:hover { background: var(--forest); color: var(--paper); }

.reader-grid { display: grid; grid-template-columns: 250px minmax(520px, 1fr) 340px; height: 100vh; padding-top: 72px; }
.library-panel, .agent-panel, .reading-panel { min-width: 0; overflow-y: auto; }
.library-panel { border-right: 1px solid var(--line); padding: 24px 14px 32px; }
.panel-kicker { align-items: end; color: var(--muted); display: flex; font-size: 10px; justify-content: space-between; letter-spacing: .22em; padding: 0 10px 14px; }
.panel-kicker b { color: var(--forest); font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: 0; }
.book-nav { display: grid; gap: 4px; }
.book-row { align-items: center; background: transparent; border: 0; border-radius: 2px; display: grid; gap: 10px; grid-template-columns: 30px 1fr 12px; min-height: 54px; padding: 7px 9px; text-align: left; transition: background 160ms ease, color 160ms ease; width: 100%; }
.book-row:hover { background: rgba(99, 125, 76, .08); }
.book-row.active { background: var(--forest); color: var(--paper); }
.spine-number { align-items: center; border-right: 1px solid var(--line); display: flex; font-family: var(--serif); font-size: 16px; height: 30px; justify-content: center; }
.book-row.active .spine-number { border-color: rgba(255,255,255,.24); }
.book-row b, .book-row small { display: block; }
.book-row b { font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.4; }
.book-row small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.book-row.active small { color: rgba(255,255,255,.65); }
.book-row i { font-style: normal; opacity: .45; }
.panel-note { border-top: 1px solid var(--line); color: var(--muted); font-family: var(--serif); font-size: 11px; line-height: 1.9; margin: 24px 10px 0; padding-top: 18px; }

.reading-panel { background: var(--white); }
.article-shell { margin: 0 auto; max-width: 860px; padding: 68px clamp(42px, 7vw, 92px) 100px; }
.book-hero { display: grid; gap: 38px; grid-template-columns: 48px 1fr; min-height: 430px; }
.hero-index { align-items: center; display: flex; flex-direction: column; gap: 16px; }
.hero-index span { align-items: center; border: 1px solid var(--green); border-radius: 50%; color: var(--forest); display: flex; font-family: var(--serif); font-size: 18px; height: 42px; justify-content: center; width: 42px; }
.hero-index i { background: linear-gradient(var(--green), transparent); display: block; height: 150px; opacity: .45; width: 1px; }
.hero-copy { min-width: 0; }
.hero-copy > p:first-child { color: var(--green); font-size: 11px; letter-spacing: .26em; margin: 9px 0 22px; }
.hero-copy h1 { font-family: var(--serif); font-size: clamp(34px, 4.4vw, 54px); font-weight: 500; letter-spacing: .04em; line-height: 1.34; margin: 0; max-width: 720px; }
.hero-copy blockquote { border-left: 2px solid var(--ochre); color: var(--forest); font-family: var(--serif); font-size: 18px; line-height: 1.75; margin: 36px 0 20px; padding: 4px 0 4px 22px; }
.hero-copy > p:last-of-type { color: var(--muted); font-size: 14px; line-height: 2; margin: 0; max-width: 680px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.keyword-list span { background: var(--jade); border-radius: 999px; color: var(--forest); font-size: 10px; letter-spacing: .06em; padding: 7px 11px; }

.chapter-section, .native-reader-section, .document-section { border-top: 1px solid var(--line); padding: 46px 0 56px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 28px; }
.section-heading small { color: var(--green); display: block; font-size: 9px; letter-spacing: .25em; margin-bottom: 7px; }
.section-heading h2 { font-family: var(--serif); font-size: 23px; font-weight: 500; letter-spacing: .08em; margin: 0; }
.section-heading > span { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.chapter-list { counter-reset: chapter; display: grid; gap: 1px; list-style: none; margin: 0; padding: 0; }
.chapter-list li { margin: 0; min-width: 0; }
.chapter-list button { align-items: center; background: var(--paper); border: 0; display: grid; gap: 14px; grid-template-columns: 36px minmax(0, 1fr) auto; min-height: 68px; padding: 12px 18px; text-align: left; transition: background 140ms ease, color 140ms ease; width: 100%; }
.chapter-list button:hover { background: var(--jade); }
.chapter-list button.active { background: var(--forest); color: var(--paper); }
.chapter-list span { color: var(--green); font-family: var(--serif); font-size: 12px; }
.chapter-list b { font-family: var(--serif); font-size: 15px; font-weight: 500; letter-spacing: .04em; }
.chapter-list small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.chapter-list button.active span, .chapter-list button.active small { color: rgba(255,253,248,.68); }
.native-reader-section { padding-top: 0; scroll-margin-top: 88px; }
.reader-toolbar { align-items: center; backdrop-filter: blur(12px); background: rgba(255,253,248,.96); border-bottom: 1px solid var(--line); display: grid; gap: 18px; grid-template-columns: auto minmax(0, 1fr) auto; margin: 0 -18px 36px; padding: 18px; position: sticky; top: 0; z-index: 12; }
.reader-toolbar > button, .reader-toolbar-actions button, .reader-footer button { background: transparent; border: 1px solid var(--line); color: var(--forest); font-size: 10px; min-height: 34px; padding: 7px 11px; }
.reader-toolbar button:hover, .reader-footer button:hover { background: var(--jade); border-color: var(--moss); }
.reader-toolbar button:disabled, .reader-footer button:disabled { cursor: default; opacity: .3; }
.reader-toolbar small { color: var(--green); display: block; font-size: 9px; letter-spacing: .15em; }
.reader-toolbar h2 { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: .04em; line-height: 1.45; margin: 5px 0 0; }
.reader-toolbar-actions { display: flex; gap: 7px; }
.native-loading { color: var(--muted); font-family: var(--serif); line-height: 2; min-height: 120px; padding: 42px 0; text-align: center; }
.manual-article { color: #29362e; font-family: var(--sans); font-size: 15px; line-height: 2.05; overflow-wrap: anywhere; user-select: text; }
.manual-block { content-visibility: auto; contain-intrinsic-size: auto 96px; }
.manual-heading { color: var(--forest); font-family: var(--serif); font-weight: 600; letter-spacing: .035em; line-height: 1.55; }
.manual-heading.level-2 { border-top: 1px solid var(--line); font-size: 25px; margin: 72px 0 25px; padding-top: 30px; }
.manual-heading.level-3 { font-size: 20px; margin: 52px 0 19px; }
.manual-heading.level-4 { font-size: 17px; margin: 38px 0 14px; }
.manual-article > .manual-heading:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.manual-paragraph { margin: 0 0 1.35em; }
.manual-paragraph strong { font-weight: 600; }
.manual-paragraph.caption { color: var(--muted); font-size: 11px; letter-spacing: .03em; margin: -12px 0 32px; text-align: center; }
.manual-paragraph.lead-title { color: var(--forest); font-family: var(--serif); font-size: 24px; line-height: 1.6; margin: 36px 0 18px; }
.manual-paragraph.lead-subtitle { color: var(--green); font-family: var(--serif); font-size: 18px; margin: -9px 0 28px; }
.manual-paragraph.callout, .manual-paragraph.quote { background: var(--paper); border-left: 2px solid var(--green); color: var(--forest); margin: 30px 0; padding: 18px 22px; }
.manual-paragraph.small { color: var(--muted); font-size: 12px; }
.manual-paragraph.align-center { text-align: center; }
.manual-paragraph.align-right { text-align: right; }
.manual-list { margin: 20px 0 30px; padding-left: 1.5em; }
.manual-list li { margin: .55em 0; padding-left: .35em; }
.manual-list li::marker { color: var(--green); }
.manual-figure { margin: 34px auto; max-width: 100%; text-align: center; }
.manual-figure img { background: var(--paper); display: block; height: auto; margin: 0 auto; max-width: 100%; width: auto; }
.manual-figure figcaption { color: var(--muted); font-size: 11px; line-height: 1.75; margin: 12px auto 0; max-width: 90%; }
.manual-table { margin: 30px 0 38px; max-width: 100%; }
.table-scroll { -webkit-overflow-scrolling: touch; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.manual-table table { border-collapse: collapse; font-size: 12px; line-height: 1.65; min-width: 100%; width: max-content; }
.manual-table th, .manual-table td { border: 1px solid var(--line); max-width: 310px; min-width: 88px; padding: 11px 13px; text-align: left; vertical-align: top; }
.manual-table th { background: var(--jade); color: var(--forest); font-weight: 600; }
.manual-table td { background: rgba(255,253,248,.68); }
.manual-table p { margin: 0 0 .55em; }
.manual-table p:last-child { margin-bottom: 0; }
.manual-table img { display: block; height: auto; max-width: 100%; }
.manual-note { border-top: 1px solid var(--line); color: var(--muted); display: grid; font-size: 11px; gap: 10px; grid-template-columns: 58px 1fr; line-height: 1.75; margin: 24px 0; padding-top: 14px; }
.manual-note b { color: var(--green); font-weight: 500; }
.manual-note p { margin: 0; }
.reader-footer { align-items: center; border-top: 1px solid var(--line); display: flex; justify-content: space-between; margin-top: 70px; padding-top: 22px; }
.reader-footer span { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-align: center; }
.text-button { background: none; border: 0; color: var(--green); font-size: 11px; padding: 8px 0; }
.document-list { display: grid; gap: 10px; }
.empty-documents { background: var(--paper); border: 1px dashed var(--line); color: var(--muted); padding: 34px; text-align: center; }
.empty-documents b { color: var(--forest); display: block; font-family: var(--serif); font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.empty-documents p { font-size: 11px; line-height: 1.8; margin: 0; }
.document-card { align-items: center; border: 1px solid var(--line); display: grid; gap: 15px; grid-template-columns: 42px 1fr auto; min-height: 74px; padding: 12px 16px; transition: background 150ms ease, border 150ms ease; }
.document-card:hover { background: var(--paper); border-color: var(--moss); }
.file-type { align-items: center; background: var(--forest); color: var(--paper); display: flex; font-size: 9px; height: 42px; justify-content: center; letter-spacing: .05em; width: 42px; }
.document-card b, .document-card small { display: block; }
.document-card b { font-family: var(--serif); font-size: 14px; font-weight: 500; line-height: 1.5; }
.document-card small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.document-actions { align-items: center; display: flex; gap: 7px; }
.document-actions button, .document-actions a { background: none; border: 0; color: var(--green); font-size: 10px; padding: 7px; text-decoration: none; }
.document-actions .remove { color: #8a4f43; }

.agent-panel { border-left: 1px solid var(--line); overflow: hidden; }
.agent-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; padding: 18px 16px; }
.agent-heading { align-items: center; display: flex; gap: 9px; }
.agent-seal { align-items: center; background: var(--forest); border-radius: 50%; color: var(--paper); display: flex; font-family: var(--serif); font-size: 13px; height: 34px; justify-content: center; width: 34px; }
.agent-heading h2 { font-family: var(--serif); font-size: 15px; font-weight: 500; margin: 0; }
.agent-heading p { color: var(--muted); font-size: 8px; margin: 3px 0 0; }
.status-dot { background: var(--ochre); border-radius: 50%; display: inline-block; height: 5px; width: 5px; }
.agent-heading, .agent-basis, .agent-form { flex: 0 0 auto; }
.agent-basis { background: var(--jade); margin: 12px 0 10px; padding: 8px 10px; }
.agent-basis small, .agent-basis b { display: block; }
.agent-basis small { color: var(--muted); font-size: 8px; margin-bottom: 3px; }
.agent-basis b { font-family: var(--serif); font-size: 10px; font-weight: 500; line-height: 1.45; }
.messages { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-gutter: stable; }
.message { font-size: 11px; line-height: 1.8; max-width: 92%; padding: 11px 13px; }
.message.agent { background: var(--white); border: 1px solid var(--line); }
.message.user { align-self: flex-end; background: var(--forest); color: var(--paper); }
.answer-message { max-width: 100%; }
.answer-message.error { border-color: #c59b92; }
.answer-actions { align-items: center; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; margin-top: 10px; padding-top: 8px; }
.answer-actions button { background: transparent; border: 0; color: var(--green); font-size: 9px; min-height: 30px; padding: 5px 7px; }
.answer-actions button:hover { background: var(--jade); }
.answer-progress { margin-bottom: 8px; }
.answer-stage { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 7px; }
.answer-stage::before { background: var(--green); border-radius: 50%; content: ''; flex: 0 0 auto; height: 6px; opacity: .45; width: 6px; }
.answer-stage.completed { color: var(--green); }
.answer-stage.completed::before { opacity: .85; }
.answer-stage.active { color: var(--ink); }
.answer-stage.active::before { animation: thinking-pulse 1.3s ease-in-out infinite; background: var(--ochre); opacity: 1; }
.answer-text h1, .answer-text h2, .answer-text h3 { font-family: var(--serif); font-weight: 600; line-height: 1.4; margin: .8em 0 .35em; }
.answer-text h1 { font-size: 1.2em; }
.answer-text h2 { font-size: 1.12em; }
.answer-text h3 { font-size: 1.05em; }
.answer-text p { margin: 0 0 .7em; }
.answer-text p:last-child { margin-bottom: 0; }
.answer-text ul, .answer-text ol { margin: .45em 0 .75em; padding-left: 1.5em; }
.answer-text li { margin: .22em 0; }
.answer-text blockquote { border-left: 2px solid var(--green); color: var(--muted); margin: .6em 0; padding-left: .75em; }
.answer-text code { background: var(--paper-deep); font-size: .92em; padding: .08em .3em; }
.answer-text pre { background: var(--paper-deep); overflow-x: auto; padding: .7em; white-space: pre-wrap; }
.answer-text pre code { background: transparent; padding: 0; }
.citation-link { color: var(--green); font-weight: 600; text-decoration: none; }
.citation-link:hover { text-decoration: underline; }
.answer-sources { border-top: 1px solid var(--line); display: grid; gap: 8px; margin-top: 12px; padding-top: 10px; }
.source-heading { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .12em; }
.source-card { background: var(--paper); border-left: 2px solid var(--green); padding: 8px 9px; }
.source-card > a { align-items: baseline; color: var(--ink); display: flex; font-size: 9px; gap: 6px; line-height: 1.5; text-decoration: none; }
.source-card > a:hover { color: var(--green); }
.source-number { color: var(--green); flex: 0 0 auto; font-weight: 600; }
.source-card > small { color: var(--muted); display: block; font-size: 8px; line-height: 1.5; margin: 4px 0 0 27px; }
.source-notes { color: var(--muted); font-size: 8px; margin: 7px 0 0 27px; }
.source-notes summary { color: var(--green); cursor: pointer; }
.source-notes p { line-height: 1.65; margin: 7px 0 0; }
.prompt-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.prompt-list button { background: transparent; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; padding: 6px 9px; }
.new-answer-button { align-self: center; background: var(--forest); border: 0; border-radius: 999px; color: var(--paper); flex: 0 0 auto; font-size: 9px; margin: 2px 0 4px; min-height: 30px; padding: 6px 12px; }
.agent-form { border-top: 1px solid var(--line); padding-top: 10px; }
.agent-composer { align-items: stretch; display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto; }
.agent-form textarea { background: var(--white); border: 1px solid var(--line); border-radius: 0; font-size: 11px; height: 58px; line-height: 1.5; max-height: 96px; min-height: 58px; outline: none; padding: 8px 9px; resize: vertical; width: 100%; }
.agent-form textarea:focus { border-color: var(--green); }
.agent-form small { color: var(--muted); display: block; font-size: 8px; line-height: 1.5; margin-top: 6px; }
.agent-form button { background: var(--forest); border: 0; color: var(--paper); font-size: 10px; min-width: 54px; padding: 8px 12px; }
.agent-form button:disabled, .agent-form textarea:disabled { cursor: not-allowed; opacity: .48; }
.source-highlight { animation: source-focus 5s ease-out; outline: 2px solid rgba(184,139,69,.72); outline-offset: 7px; }

@keyframes thinking-pulse { 0%, 100% { opacity: .35; transform: scale(.75); } 50% { opacity: 1; transform: scale(1); } }
@keyframes source-focus { 0%, 55% { background: rgba(220,201,149,.38); } 100% { background: transparent; } }

.mobile-bar, .sheet-wrap { display: none; }
.manage-dialog { background: var(--white); border: 1px solid var(--line); box-shadow: 0 28px 90px rgba(37,52,43,.18); color: var(--ink); max-width: 560px; padding: 42px; width: calc(100% - 32px); }
.manage-dialog::backdrop { backdrop-filter: blur(5px); background: rgba(37,52,43,.46); }
.dialog-close { background: none; border: 0; color: var(--muted); font-family: var(--serif); font-size: 26px; position: absolute; right: 17px; top: 11px; }
.manage-dialog section > small { color: var(--green); font-size: 9px; letter-spacing: .24em; }
.manage-dialog h2 { font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: .08em; margin: 9px 0 12px; }
.manage-dialog section > p { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 0 0 23px; }
.manage-dialog form { display: grid; gap: 14px; }
.manage-dialog label { color: var(--muted); display: grid; font-size: 10px; gap: 7px; }
.manage-dialog input, .manage-dialog select { background: var(--paper); border: 1px solid var(--line); border-radius: 0; min-height: 42px; outline: none; padding: 9px 11px; width: 100%; }
.manage-dialog input:focus, .manage-dialog select:focus { border-color: var(--green); }
.solid-button { background: var(--forest); border: 0; color: var(--paper); min-height: 42px; padding: 9px 16px; }
.form-error { color: #8a4f43 !important; font-size: 10px !important; margin: 0 !important; min-height: 16px; }
.drop-zone { align-items: center; background: var(--paper); border: 1px dashed var(--moss) !important; cursor: pointer; display: flex !important; min-height: 130px; justify-content: center; padding: 22px; text-align: center; }
.drop-zone.dragging { background: var(--jade); border-style: solid !important; }
.drop-zone input { display: none; }
.drop-zone b { color: var(--forest); font-family: var(--serif); font-size: 14px; font-weight: 500; }
.drop-zone span { color: var(--muted); font-size: 9px; line-height: 1.7; max-width: 360px; }
.upload-queue { display: grid; gap: 6px; max-height: 120px; overflow-y: auto; }
.queue-item { align-items: center; background: var(--jade); display: flex; font-size: 9px; justify-content: space-between; padding: 7px 9px; }
.queue-item progress { accent-color: var(--green); height: 5px; width: 90px; }
.form-actions { align-items: center; display: flex; justify-content: space-between; }

@media (max-width: 1180px) {
  .reader-grid { grid-template-columns: 220px minmax(480px, 1fr) 310px; }
  .article-shell { padding-left: 46px; padding-right: 46px; }
}

@media (max-width: 920px) {
  body { padding-bottom: 64px; }
  body.sheet-open { overflow: hidden; }
  .topbar { height: 60px; padding: 0 18px; }
  .brand b { font-size: 14px; }
  .brand small, .private-mark { display: none; }
  .reader-grid { display: block; height: auto; padding-top: 60px; }
  .library-panel, .agent-panel { display: none; }
  .reading-panel { min-height: calc(100vh - 124px); overflow: visible; }
  .article-shell { padding: 42px 22px 80px; }
  .book-hero { gap: 18px; grid-template-columns: 34px 1fr; min-height: 0; padding-bottom: 70px; }
  .hero-index span { font-size: 14px; height: 32px; width: 32px; }
  .hero-index i { height: 110px; }
  .hero-copy h1 { font-size: clamp(29px, 8.7vw, 42px); overflow-wrap: anywhere; }
  .hero-copy blockquote { font-size: 16px; margin-top: 28px; }
  .chapter-section, .native-reader-section, .document-section { padding: 38px 0 45px; }
  .section-heading { align-items: start; gap: 14px; }
  .section-heading h2 { font-size: 20px; }
  .chapter-list button { grid-template-columns: 30px minmax(0, 1fr); padding: 12px 13px; }
  .chapter-list button small { display: none; }
  .native-reader-section { margin-left: -2px; margin-right: -2px; scroll-margin-top: 66px; }
  .reader-toolbar { gap: 9px; grid-template-columns: 1fr auto; margin-left: -20px; margin-right: -20px; padding: 14px 20px; top: 60px; }
  .reader-toolbar > button { display: none; }
  .reader-toolbar h2 { font-size: 16px; }
  .reader-toolbar-actions { align-self: center; }
  .reader-toolbar-actions button { min-height: 32px; padding: 6px 9px; }
  .manual-article { font-size: 15px; line-height: 1.95; }
  .manual-heading.level-2 { font-size: 22px; margin-top: 58px; padding-top: 25px; }
  .manual-heading.level-3 { font-size: 19px; margin-top: 44px; }
  .manual-paragraph { margin-bottom: 1.25em; }
  .manual-table { margin-left: -6px; margin-right: -6px; }
  .manual-table table { font-size: 11px; }
  .manual-table th, .manual-table td { min-width: 104px; padding: 9px 10px; }
  .reader-footer { gap: 8px; margin-top: 54px; }
  .reader-footer span { font-size: 8px; }
  .document-card { grid-template-columns: 38px 1fr; }
  .document-actions { grid-column: 2; }
  .mobile-bar { background: rgba(245,241,231,.97); border-top: 1px solid var(--line); bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: 64px; left: 0; position: fixed; right: 0; z-index: 60; }
  .mobile-bar button { background: none; border: 0; color: var(--muted); font-size: 9px; }
  .mobile-bar span { display: block; font-family: var(--serif); font-size: 18px; margin-bottom: 2px; }
  .mobile-bar .primary { background: var(--forest); color: var(--paper); }
  .sheet-wrap { display: block; height: var(--visual-viewport-height, 100dvh); left: 0; position: fixed; right: 0; top: var(--visual-viewport-offset-top, 0px); z-index: 80; }
  .sheet-backdrop { background: rgba(37,52,43,.38); border: 0; inset: 0; position: absolute; width: 100%; }
  .mobile-sheet { background: var(--paper); bottom: 0; display: flex; flex-direction: column; max-height: min(88dvh, calc(var(--visual-viewport-height, 100dvh) - 8px)); overflow: hidden; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); position: absolute; width: 100%; }
  .mobile-sheet:focus { outline: none; }
  .mobile-sheet.agent-sheet { height: min(88dvh, calc(var(--visual-viewport-height, 100dvh) - 8px)); }
  .mobile-sheet > header { align-items: center; border-bottom: 1px solid var(--line); display: flex; flex: 0 0 auto; justify-content: space-between; margin-bottom: 12px; padding: 0 5px 12px; }
  .mobile-sheet > header small { color: var(--green); font-size: 9px; letter-spacing: .2em; }
  .mobile-sheet > header h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 5px 0 0; }
  .sheet-close { background: none; border: 0; font-family: var(--serif); font-size: 26px; min-height: 44px; min-width: 44px; }
  #sheetContent { min-height: 0; overflow-y: auto; }
  .mobile-sheet.agent-sheet #sheetContent { display: flex; flex: 1 1 auto; overflow: hidden; }
  .mobile-sheet .agent-inner { flex: 1 1 auto; height: auto; min-height: 0; padding: 2px 4px 0; width: 100%; }
  .mobile-sheet .agent-heading { display: none; }
  .mobile-sheet .agent-basis { margin-top: 0; }
  .mobile-sheet .messages { flex: 1 1 auto; min-height: 0; padding-bottom: 3px; scrollbar-gutter: auto; }
  .mobile-sheet .message { font-size: 13px; line-height: 1.75; }
  .mobile-sheet .agent-form { background: var(--paper); flex: 0 0 auto; padding-bottom: env(safe-area-inset-bottom); }
  .mobile-sheet .agent-form textarea { font-size: 16px; height: 46px; max-height: 120px; min-height: 46px; resize: none; }
  .mobile-sheet .agent-form button { min-height: 46px; min-width: 60px; }
  .mobile-sheet .agent-form small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-chapter-list { max-height: 66vh; overflow-y: auto; }
  .manage-dialog { padding: 34px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
