:root {
  --ink: #18202f;
  --muted: #7d8796;
  --line: #e8ebf1;
  --soft: #f7f8fb;
  --blue: #557dff;
  --blue-deep: #315cd8;
  --lavender: #f0efff;
  --purple: #a87dec;
  --mint: #41c9bc;
  --peach: #f2ab56;
  --rose: #ef7ba8;
  --shadow: 0 18px 50px rgba(40, 47, 70, .11);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #fff; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 30px; gap: 28px; background: rgba(255,255,255,.96); }
.brand { width: 300px; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 28px; height: 28px; display: grid; grid-template-columns: repeat(3, 6px); gap: 3px; align-items: end; }
.brand-mark span { display: block; border-radius: 3px 3px 0 0; background: var(--blue); }
.brand-mark span:nth-child(1) { height: 12px; opacity: .55; }.brand-mark span:nth-child(2) { height: 21px; }.brand-mark span:nth-child(3) { height: 15px; opacity: .75; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }.brand-name em { font-style: normal; font-weight: 400; color: var(--blue); }
.brand-subtitle { font: 10px "DM Mono", monospace; color: #a0a8b5; text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }
.source-status { flex: 1; display: flex; align-items: center; gap: 8px; color: #657083; font-size: 12px; min-width: 0; }.source-status #source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 440px; }.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #48cdbd; box-shadow: 0 0 0 4px #e8faf7; flex: none; }.source-badge, .native-chip { border: 1px solid #d9e1ff; color: var(--blue); background: #f5f7ff; padding: 5px 8px; border-radius: 5px; font: 9px "DM Mono", monospace; letter-spacing: .05em; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 9px; }.icon-button { width: 34px; height: 34px; background: transparent; color: #1f2530; position: relative; }.copy-icon, .download-icon { position: absolute; inset: 8px; display: block; }.copy-icon:before, .copy-icon:after { content: ""; position: absolute; border: 2px solid #1c232e; border-radius: 2px; width: 12px; height: 13px; }.copy-icon:before { left: 4px; top: 4px; }.copy-icon:after { left: 0; top: 0; background: white; }.download-icon:before { content: ""; position: absolute; width: 4px; height: 14px; background: #1c232e; left: 7px; top: 1px; border-radius: 2px; }.download-icon:after { content: ""; position: absolute; left: 2px; bottom: 0; width: 15px; height: 8px; border: 2px solid #1c232e; border-top: 0; }.button { border-radius: 5px; padding: 10px 14px; font-size: 12px; font-weight: 600; }.button-outline { color: var(--blue); border: 1px solid #cbd6ff; background: #f8f9ff; }.upload-button input { display: none; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(420px, 42%) 1fr; }
.document-pane { min-height: calc(100vh - 76px); background: #f5f7fc; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.pane-toolbar { height: 57px; padding: 0 23px; border-bottom: 1px solid #e3e8f2; display: flex; align-items: center; justify-content: space-between; background: #fff; }.page-control, .document-tools, .document-footer, .footer-legend { display: flex; align-items: center; }.page-control { gap: 7px; }.toolbar-label, .footer-label, .metric-label, .eyebrow { font: 10px "DM Mono", monospace; color: #9ca5b4; letter-spacing: .08em; }.toolbar-label { margin-right: 5px; }.round-button { width: 24px; height: 24px; border-radius: 50%; background: #f1f3f8; color: #707b8e; font-size: 20px; line-height: 20px; }.page-control input { width: 38px; border: 1px solid #dce1eb; border-radius: 4px; padding: 4px; text-align: center; color: var(--blue); font: 12px "DM Mono", monospace; outline-color: var(--blue); }.page-total { color: #9da6b2; font: 12px "DM Mono", monospace; }.document-tools { gap: 7px; }.tool-button { background: transparent; color: #8390a1; display: flex; gap: 7px; align-items: center; font-size: 11px; padding: 8px; }.tool-button:hover, .tool-button.active { color: var(--blue); }.layers-icon { width: 13px; height: 11px; border: 1px solid currentColor; border-radius: 2px; position: relative; }.layers-icon:before, .layers-icon:after { content: ""; position: absolute; left: 2px; right: -3px; height: 8px; border: 1px solid currentColor; border-radius: 2px; background: #fff; }.layers-icon:before { top: -4px; }.layers-icon:after { top: -7px; left: 5px; right: -5px; }.expand-icon { width: 13px; height: 13px; border: 1px solid currentColor; position: relative; }.expand-icon:before, .expand-icon:after { content: ""; position: absolute; background: currentColor; }.expand-icon:before { width: 18px; height: 1px; left: -3px; top: 5px; }.expand-icon:after { width: 1px; height: 18px; left: 5px; top: -3px; }
.document-stage { flex: 1; position: relative; overflow: auto; display: flex; justify-content: center; padding: 30px 40px 84px; background: #f1f4fa; }.stage-grid { position: absolute; inset: 0; opacity: .4; background-image: linear-gradient(#e9edf5 1px, transparent 1px), linear-gradient(90deg, #e9edf5 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }.page-shadow { width: min(100%, 520px); flex: none; align-self: flex-start; position: relative; box-shadow: var(--shadow); z-index: 1; }.page-sheet { position: relative; width: 100%; aspect-ratio: 432 / 648; background: white; overflow: hidden; }.page-sheet img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }.page-overlays { position: absolute; inset: 0; pointer-events: none; }.page-overlays.hidden { display: none; }.overlay { position: absolute; border: 2px solid var(--blue); background: rgba(85,125,255,.08); pointer-events: auto; cursor: pointer; transition: background .15s, border-color .15s; }.overlay:hover, .overlay.selected { background: rgba(85,125,255,.2); border-color: #315cd8; z-index: 3; }.overlay.picture { border-color: var(--purple); background: rgba(168,125,236,.1); }.overlay.caption { border-color: var(--peach); background: rgba(242,171,86,.12); }.overlay.formula { border-color: var(--mint); background: rgba(65,201,188,.13); }.overlay.section { border-color: var(--rose); background: rgba(239,123,168,.1); }.overlay-label { position: absolute; top: -18px; left: -2px; padding: 2px 4px; border-radius: 3px 3px 0 0; color: white; background: var(--blue); font: 9px "DM Mono", monospace; opacity: 0; transition: opacity .15s; }.overlay:hover .overlay-label, .overlay.selected .overlay-label { opacity: 1; }.overlay.picture .overlay-label { background: var(--purple); }.overlay.caption .overlay-label { background: var(--peach); }.overlay.formula .overlay-label { background: var(--mint); }.overlay.section .overlay-label { background: var(--rose); }.zoom-control { position: absolute; z-index: 2; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 17px; padding: 9px 14px; border: 1px solid #dce4fb; border-radius: 28px; background: rgba(255,255,255,.95); box-shadow: 0 6px 18px rgba(74,90,132,.1); color: var(--blue); }.zoom-control button { background: transparent; color: var(--blue); font-size: 24px; font-weight: 300; line-height: 18px; }.zoom-control span { min-width: 44px; text-align: center; font-size: 12px; }.document-footer { min-height: 39px; justify-content: space-between; padding: 0 24px; gap: 12px; background: #fff; color: #8490a1; font-size: 10px; }.footer-label { margin-right: 8px; }.footer-legend { gap: 8px; }.legend-item { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-left: 6px; }.legend-picture { background: var(--purple); }.legend-text { background: var(--blue); }.legend-formula { background: var(--mint); }

.inspector-pane { min-width: 0; display: flex; flex-direction: column; background: #fff; }.tabs { height: 57px; display: flex; align-items: stretch; gap: 29px; padding: 0 30px; border-bottom: 1px solid var(--line); }.tab { position: relative; background: transparent; color: #111823; font-size: 14px; padding: 0; }.tab.active { color: var(--blue); }.tab.active:after { content: ""; position: absolute; height: 2px; background: var(--blue); left: 0; right: 0; bottom: -1px; }.inspector-content { flex: 1; min-height: 0; overflow: hidden; }.view { height: 100%; overflow: auto; padding: 44px 37px 60px; display: none; }.view.active { display: block; }.view-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 27px; }.view-heading h1 { font: 700 26px "Libre Baskerville", serif; letter-spacing: -.04em; margin: 7px 0 0; color: #1c2432; }.live-pill, .chat-model { border-radius: 12px; padding: 6px 10px; background: #effbf8; color: #2ea899; font: 10px "DM Mono", monospace; text-transform: uppercase; }.live-pill .status-dot { width: 5px; height: 5px; box-shadow: none; margin-right: 5px; }.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 29px; }.metric-card, .extraction-card, .legend-card, .settings-card { border: 1px solid var(--line); border-radius: 7px; background: #fff; }.metric-card { padding: 13px 12px 12px; min-height: 90px; }.metric-card strong { display: block; margin-top: 12px; font-size: 15px; letter-spacing: -.02em; }.metric-card small { display: block; margin-top: 5px; color: #a2aab6; font-size: 10px; }.metric-label { font-size: 8px; }.extraction-card { padding: 19px 21px 11px; margin-bottom: 16px; }.card-title-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; margin-bottom: 12px; }.mono { font-family: "DM Mono", monospace; }.muted { color: #9ea6b3; font-size: 10px; }.pipeline-step { display: grid; grid-template-columns: 26px 1fr 18px; gap: 10px; padding: 15px 0; border-top: 1px solid #f0f1f5; }.step-number { color: var(--blue); font: 10px "DM Mono", monospace; padding-top: 2px; }.pipeline-step strong { font-size: 12px; }.pipeline-step p { margin: 5px 0 0; color: #8e98a8; font-size: 11px; line-height: 1.45; }.step-check { width: 17px; height: 17px; border-radius: 50%; color: white; background: var(--mint); text-align: center; font-size: 11px; line-height: 17px; }.legend-card { padding: 19px 21px; }.type-legend { display: flex; flex-wrap: wrap; gap: 8px; }.type-chip { display: inline-flex; gap: 6px; align-items: center; border-radius: 4px; padding: 6px 8px; color: #647084; background: #f7f8fb; font: 10px "DM Mono", monospace; }.type-chip i { width: 7px; height: 7px; border-radius: 2px; display: block; }.type-chip.picture i { background: var(--purple); }.type-chip.caption i { background: var(--peach); }.type-chip.formula i { background: var(--mint); }.type-chip.section i { background: var(--rose); }.type-chip.paragraph i { background: var(--blue); }

.text-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }.filter-pill, .suggestion-row button { border: 1px solid #e1e5ee; background: #fff; color: #8c96a5; padding: 6px 9px; border-radius: 15px; font-size: 10px; }.filter-pill.active { color: var(--blue); background: #f3f6ff; border-color: #cedaff; }.filter-pill span { font: 9px "DM Mono", monospace; margin-left: 3px; }.block-list { display: flex; flex-direction: column; gap: 11px; }.block-card { border: 1px solid #e3e6ed; border-radius: 7px; padding: 19px 21px 19px; transition: border-color .15s, box-shadow .15s; }.block-card:hover, .block-card.selected { border-color: #bdcaff; box-shadow: 0 5px 18px rgba(78,103,180,.07); }.block-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }.block-tag { display: inline-flex; align-items: center; gap: 7px; font: 10px "DM Mono", monospace; color: var(--blue); }.block-tag:before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }.block-tag.picture { color: var(--purple); }.block-tag.picture:before { background: var(--purple); }.block-tag.caption { color: var(--peach); }.block-tag.caption:before { background: var(--peach); }.block-tag.formula { color: var(--mint); }.block-tag.formula:before { background: var(--mint); }.block-tag.section { color: var(--rose); }.block-tag.section:before { background: var(--rose); }.block-location { color: #a1a8b2; font: 9px "DM Mono", monospace; }.block-text { color: #303746; font-size: 14px; line-height: 1.65; white-space: pre-line; }.block-card.picture .block-text { color: #8793a4; font-size: 12px; }.block-card.formula .block-text { font-family: "DM Mono", monospace; color: #3d817c; font-size: 13px; }.block-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }.text-action { background: transparent; color: #a0a8b4; font: 10px "DM Mono", monospace; }.text-action:hover { color: var(--blue); }.loading-state, .empty-chat { color: #9aa4b2; text-align: center; padding: 60px 20px; font-size: 13px; }.mini-button { border: 1px solid #dce3f2; color: var(--blue); background: #f9faff; border-radius: 4px; font: 10px "DM Mono", monospace; padding: 7px 10px; }.json-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }.json-view { margin: 0; border: 1px solid #e2e7f1; border-radius: 7px; padding: 20px; min-height: 470px; overflow: auto; background: #f8f9fc; color: #3f4c65; font: 11px/1.6 "DM Mono", monospace; white-space: pre-wrap; }
.chat-intro { display: flex; align-items: center; gap: 13px; border: 1px solid #e4e7f1; border-radius: 8px; padding: 15px; background: linear-gradient(135deg, #fafbff, #f7fdfc); }.chat-orb { width: 32px; height: 32px; border-radius: 10px; background: var(--blue); color: white; display: grid; place-items: center; font-size: 17px; }.chat-intro strong { font-size: 12px; }.chat-intro p { margin: 3px 0 0; color: #8e99a7; font-size: 11px; line-height: 1.4; }.suggestion-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0; }.suggestion-row button:hover { color: var(--blue); border-color: #c9d5ff; }.chat-thread { min-height: 235px; max-height: 390px; overflow: auto; }.empty-chat span { display: block; color: #b4bdc9; font-size: 25px; transform: rotate(90deg); margin-bottom: 12px; }.empty-chat p { margin: 0; }.chat-message { display: flex; margin: 15px 0; gap: 9px; }.chat-message.user { justify-content: flex-end; }.chat-bubble { max-width: 82%; border-radius: 9px; padding: 10px 12px; font-size: 12px; line-height: 1.5; }.chat-message.assistant .chat-bubble { background: #f3f6ff; color: #49556b; }.chat-message.user .chat-bubble { background: var(--blue); color: white; }.chat-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 13px; border: 1px solid #dce3ee; border-radius: 7px; padding: 8px; }.chat-form:focus-within { border-color: #b8c7ff; box-shadow: 0 0 0 3px #f1f4ff; }.chat-form textarea { flex: 1; resize: none; border: 0; outline: 0; color: #354054; font-size: 12px; line-height: 1.4; padding: 4px; }.send-button { width: 29px; height: 29px; border-radius: 5px; background: var(--blue); color: white; font-size: 18px; line-height: 1; }.chat-note { color: #a0a9b6; font-size: 10px; line-height: 1.45; margin-top: 11px; }.settings-card { padding: 6px 20px; margin-bottom: 13px; }.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0; border-bottom: 1px solid #f0f1f4; }.setting-row:last-child { border-bottom: 0; }.setting-row strong { font-size: 12px; }.setting-row p { margin: 4px 0 0; color: #939eae; font-size: 11px; }.setting-value { color: var(--blue); font: 10px "DM Mono", monospace; white-space: nowrap; }.toggle { color: #9aa5b4; font: 10px "DM Mono", monospace; white-space: nowrap; }.toggle span { display: inline-block; width: 22px; height: 12px; border-radius: 10px; background: #dce1eb; vertical-align: -2px; margin-right: 5px; position: relative; }.toggle span:after { content: ""; position: absolute; width: 8px; height: 8px; left: 2px; top: 2px; border-radius: 50%; background: #fff; }.settings-card code { display: block; background: #f5f7fb; border-radius: 4px; padding: 11px 12px; color: #53627b; font: 11px "DM Mono", monospace; }.setting-help { margin: 12px 0 7px; color: #9aa4b3; font-size: 11px; }
.answer-text { white-space: pre-wrap; }.inline-reference { display: inline-flex; align-items: center; margin: 0 2px; padding: 1px 5px; border-radius: 4px; background: #dfe7ff; color: var(--blue-deep); font: 9px "DM Mono", monospace; vertical-align: 1px; }.inline-reference:hover { background: #cbd8ff; }.answer-references { display: grid; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #dce4f7; }.reference-heading { color: #77849a; font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }.reference-card { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; width: 100%; padding: 8px; border: 1px solid #d9e2fa; border-radius: 6px; background: rgba(255,255,255,.78); color: #43506a; text-align: left; }.reference-card:hover { border-color: #9fb5ff; background: #fff; }.reference-pill { min-width: 25px; padding: 3px 5px; border-radius: 4px; background: #e7edff; color: var(--blue); font: 9px "DM Mono", monospace; text-align: center; }.reference-card strong, .reference-card small { display: block; }.reference-card strong { font-size: 10px; }.reference-card small { margin-top: 3px; color: #7f8a9d; font-size: 9px; line-height: 1.35; max-height: 2.7em; overflow: hidden; }.overlay.reference { z-index: 9; border: 3px solid #557dff; background: rgba(85,125,255,.2); box-shadow: 0 0 0 9999px rgba(20,28,45,.16); pointer-events: none; animation: reference-pulse .7s ease-out; }.overlay.reference .overlay-label { opacity: 1; background: #557dff; }.scroll-page:has(.overlay.reference) { z-index: 3; } @keyframes reference-pulse { from { background: rgba(85,125,255,.48); } to { background: rgba(85,125,255,.2); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: #18202f; color: white; padding: 10px 13px; border-radius: 5px; font-size: 11px; transition: .2s; z-index: 10; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.scroll-hint { color: #9aa4b3; font: 9px "DM Mono", monospace; margin-right: 7px; }
@media (max-width: 650px) { .scroll-hint { display: none; } }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e3e7f0; border-radius: 8px; padding: 16px 18px; background: linear-gradient(135deg, #fafbff, #f8fcff); margin-bottom: 15px; }.library-toolbar strong { font-size: 12px; }.library-toolbar p { margin: 4px 0 0; color: #929dad; font-size: 11px; }.library-list { display: flex; flex-direction: column; gap: 9px; }.library-item { display: flex; align-items: center; gap: 12px; border: 1px solid #e3e7ef; border-radius: 7px; padding: 12px 13px; background: #fff; }.library-item.active { border-color: #bdcaff; box-shadow: 0 5px 18px rgba(78,103,180,.07); }.book-cover { width: 34px; height: 42px; display: grid; place-items: center; border-radius: 4px; color: var(--blue); background: #eef2ff; font-size: 19px; flex: none; }.library-details { min-width: 0; flex: 1; }.library-details strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }.library-details span { display: block; color: #949eac; font: 9px "DM Mono", monospace; margin-top: 5px; }.library-actions { display: flex; align-items: center; gap: 6px; }.library-action { border: 1px solid #dce3f2; border-radius: 4px; background: #f9faff; color: var(--blue); padding: 7px 9px; font: 10px "DM Mono", monospace; }.library-action:hover { border-color: #bdcaff; }.library-remove { width: 26px; height: 26px; border-radius: 4px; background: transparent; color: #a8b0bc; font-size: 18px; }.library-remove:hover { background: #fff2f5; color: #d66a8f; }.library-note { color: #9da6b4; font-size: 10px; line-height: 1.45; margin-top: 15px; }.library-note .status-dot { width: 5px; height: 5px; box-shadow: none; margin-right: 5px; }.api-card { padding: 19px 20px 15px; }.api-help { margin: -2px 0 15px; color: #919cac; font-size: 11px; line-height: 1.45; }.api-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }.api-form-grid label { color: #8f99a8; font: 9px "DM Mono", monospace; }.api-form-grid .full-field { grid-column: 1 / -1; }.api-form-grid input, .api-form-grid select { display: block; width: 100%; margin-top: 6px; border: 1px solid #dfe4ed; border-radius: 4px; padding: 9px 10px; color: #49566c; background: #fff; outline-color: #b7c7ff; font: 11px "DM Sans", sans-serif; }.api-form-grid select { font-family: "DM Mono", monospace; font-size: 10px; }.api-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }.api-action-buttons { display: flex; gap: 7px; }.api-action-buttons button:disabled { cursor: wait; opacity: .6; }.remember-key { color: #99a2af; font: 9px "DM Mono", monospace; }.remember-key input { vertical-align: -2px; accent-color: var(--blue); }
.library-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }.library-toolbar-actions > span { color: #8b96a8; font: 9px "DM Mono", monospace; }.library-toolbar-actions button:disabled { cursor: default; opacity: .45; }.library-select { width: 28px; height: 42px; display: grid; place-items: center; flex: none; cursor: pointer; }.library-select input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); cursor: pointer; }.library-item.selected { border-color: #9fb3ff; background: #fbfcff; box-shadow: 0 5px 18px rgba(78,103,180,.08); }
@media (max-width: 650px) { .library-toolbar { align-items: flex-start; flex-direction: column; }.library-toolbar-actions { width: 100%; justify-content: flex-start; }.api-form-grid { grid-template-columns: 1fr; }.api-form-grid .full-field { grid-column: auto; }.api-form-footer { align-items: flex-start; flex-direction: column; } }
@media (max-width: 1000px) { .workspace { grid-template-columns: 1fr; }.document-pane { height: 70vh; min-height: 460px; max-height: 760px; border-right: 0; border-bottom: 1px solid var(--line); }.inspector-pane { min-height: 630px; }.topbar { padding: 0 16px; gap: 12px; }.brand { width: auto; }.source-status { display: none; }.tabs { gap: 18px; padding: 0 20px; }.view { padding: 30px 20px 45px; } }
@media (max-width: 650px) { .topbar { height: auto; min-height: 66px; }.brand-subtitle { display: none; }.brand-name { font-size: 17px; }.icon-button { display: none; }.upload-button { padding: 8px 10px; }.pane-toolbar { padding: 0 12px; }.document-tools .tool-button span:last-child { display: none; }.document-stage { padding: 20px 12px 80px; }.document-footer { padding: 0 12px; }.footer-legend { display: none; }.tabs { gap: 15px; padding: 0 15px; overflow: auto; }.tab { font-size: 12px; white-space: nowrap; }.metric-grid { grid-template-columns: repeat(2, 1fr); }.view-heading h1 { font-size: 22px; }.block-card { padding: 15px; }.block-location { display: none; } }
.page-progress { flex: 1; min-width: 115px; max-width: 190px; margin: 0 13px; }
.page-progress-meta, .context-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #9aa4b3; font: 8px "DM Mono", monospace; letter-spacing: .04em; text-transform: uppercase; }
.page-progress-track, .context-progress-track { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 5px; background: #edf0f6; }
.page-progress-track span, .context-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #91a8ff); transition: width .25s ease; }
.llm-context-card { border: 1px solid #e0e6f4; border-radius: 8px; padding: 13px 15px 12px; background: linear-gradient(135deg, #fafbff, #f8fcff); }
.llm-context-card.busy { border-color: #bdcaff; box-shadow: 0 0 0 3px #f3f5ff; }
.llm-context-card.busy .context-progress-track span { background: linear-gradient(90deg, var(--blue) 0%, #b5c4ff 50%, var(--blue) 100%); background-size: 200% 100%; animation: context-progress-shimmer 1.2s linear infinite; }
.context-progress-track { height: 6px; margin-top: 9px; }
.context-card-status { margin-top: 8px; color: #8d98a8; font-size: 10px; line-height: 1.4; }
@keyframes context-progress-shimmer { to { background-position: -200% 0; } }
@media (max-width: 650px) { .page-progress { min-width: 0; margin: 0 8px; }.page-progress-meta span:first-child { display: none; }.page-progress-meta { justify-content: flex-end; }.page-progress-track { margin-top: 5px; } }
.document-stage, .inspector-content, .view, .chat-thread, .json-view { scroll-behavior: smooth; overscroll-behavior: contain; }
.page-sheet img.page-image-loading { opacity: .35; }
.page-sheet img.page-image-next { animation: page-image-next .28s ease both; }
.page-sheet img.page-image-prev { animation: page-image-prev .28s ease both; }
@keyframes page-image-next { from { opacity: .35; transform: translateX(12px) scale(.99); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes page-image-prev { from { opacity: .35; transform: translateX(-12px) scale(.99); } to { opacity: 1; transform: translateX(0) scale(1); } }
.legend-table { background: #d09a55; }
.overlay.table { border-color: #d09a55; background: rgba(208,154,85,.12); }
.overlay.table .overlay-label { background: #d09a55; }
.type-chip.table i { background: #d09a55; }
.block-tag.table { color: #b67d35; }
.block-tag.table:before { background: #d09a55; }
.block-card.table .block-text { color: #795c37; font-size: 12px; line-height: 1.5; }
.page-stack { width: min(100%, 520px); flex: none; display: flex; flex-direction: column; gap: 28px; z-index: 1; }
.document-stage { min-height: 0; }
.scroll-page { position: relative; width: 100%; aspect-ratio: 432 / 648; flex: none; overflow: hidden; background: #fff; box-shadow: var(--shadow); scroll-margin-block: 35vh; contain: layout paint; }
.scroll-page > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: fill; }
.page-number-badge { position: absolute; right: 10px; bottom: 9px; padding: 4px 6px; border-radius: 3px; color: #8a96a8; background: rgba(255,255,255,.9); font: 9px "DM Mono", monospace; opacity: 0; transition: opacity .2s, color .2s; }
.scroll-page.active .page-number-badge { color: var(--blue); opacity: 1; }
.app-shell { height: 100vh; min-height: 100vh; overflow: hidden; }
.workspace { height: 0; min-height: 0; flex: 1 1 auto; }
@media (min-width: 1001px) { .workspace { overflow: hidden; }.document-pane, .inspector-pane { height: 100%; min-height: 0; } }
@media (min-width: 1001px) { .workspace.chat-mode { grid-template-columns: minmax(460px, 1fr) minmax(520px, 48%); }.workspace.chat-mode .inspector-pane { order: 1; }.workspace.chat-mode .document-pane { order: 2; border-right: 0; border-left: 1px solid var(--line); }.workspace.chat-mode .chat-message.assistant .chat-bubble { width: 100%; max-width: 100%; } }
@media (max-width: 1000px) { .app-shell { height: auto; min-height: 100vh; overflow: visible; }.workspace { height: auto; } }
 [data-panel="chat"].active { display: flex; flex-direction: column; overflow: hidden; }.chat-thread { flex: 1; max-height: none; }.chat-form, .chat-note { flex: none; }
 .formula-status { display: inline-block; margin: -3px 0 10px; color: #8e98a8; font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .04em; }
 .upload-progress-card { position: fixed; right: 22px; bottom: 22px; z-index: 20; width: min(360px, calc(100vw - 44px)); padding: 16px 18px 14px; border: 1px solid #dfe5f3; border-radius: 10px; background: rgba(255,255,255,.97); box-shadow: 0 14px 40px rgba(38,51,88,.16); }.upload-progress-card[hidden] { display: none; }.upload-progress-head, .upload-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.upload-progress-head { color: #27324a; font-size: 12px; }.upload-progress-head span { color: var(--blue); font: 11px "DM Mono", monospace; }.upload-progress-track { height: 8px; margin-top: 12px; overflow: hidden; border-radius: 8px; background: #edf1f8; }.upload-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint)); transition: width .25s ease; }.upload-progress-card.running .upload-progress-track span { background: linear-gradient(90deg, var(--blue) 0%, #a7b8ff 50%, var(--blue) 100%); background-size: 200% 100%; animation: upload-progress-shimmer 1.3s linear infinite; }.upload-progress-card.error .upload-progress-track span { background: #e77b9a; }.upload-progress-meta { margin-top: 8px; color: #8792a5; font: 9px "DM Mono", monospace; text-transform: uppercase; }.upload-progress-card p { margin: 8px 0 0; color: #6f7a8d; font-size: 11px; line-height: 1.4; }.upload-progress-card.error p { color: #bd5c78; } @keyframes upload-progress-shimmer { to { background-position: -200% 0; } }
 .library-description { display: block; margin-top: 7px; color: #66738a; font-size: 10px; line-height: 1.4; }
 .library-item.processing { align-items: flex-start; border-color: #bdcaff; box-shadow: 0 5px 18px rgba(78,103,180,.08); }
 .library-item.processing .book-cover { background: #e8eeff; }
 .library-action:disabled { cursor: wait; opacity: .58; }
 .library-progress { margin-top: 10px; }
 .library-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #7e899b; font: 9px "DM Mono", monospace; }
 .library-progress-meta strong { color: #56647a; font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .03em; }
 .library-progress-track { height: 6px; margin-top: 7px; overflow: hidden; border-radius: 6px; background: #edf1f8; }
 .library-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint)); transition: width .25s ease; }
 .library-progress.running .library-progress-track span { background: linear-gradient(90deg, var(--blue) 0%, #b4c2ff 50%, var(--blue) 100%); background-size: 200% 100%; animation: upload-progress-shimmer 1.3s linear infinite; }
 .library-progress.error .library-progress-track span { background: #e77b9a; }
 .library-progress small { display: block; margin-top: 6px; color: #8c97a8; font-size: 9px; line-height: 1.35; }
 @media (max-width: 650px) { .library-item { align-items: flex-start; flex-wrap: wrap; }.library-details { width: calc(100% - 46px); }.library-actions { width: 100%; justify-content: flex-end; } }
 .transaction-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 18px; border: 1px solid #dfe6f5; border-radius: 8px; background: linear-gradient(135deg, #f8faff, #f7fcfb); }
 .transaction-intro strong { color: #29354c; font-size: 12px; }.transaction-intro p { margin: 5px 0 0; color: #818da1; font-size: 10px; line-height: 1.45; }
 .transaction-status { margin: 12px 0; padding: 10px 12px; border-radius: 6px; color: #6e7b90; background: #f6f8fc; font: 9px "DM Mono", monospace; line-height: 1.45; }
 .transaction-status.busy { color: var(--blue); background: #eff3ff; }.transaction-status.error { color: #bd5c78; background: #fff2f5; }
 .transaction-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
 .transaction-metrics > div { min-width: 0; padding: 12px; border: 1px solid #e3e7f0; border-radius: 7px; background: #fff; }
 .transaction-metrics span { display: block; color: #98a2b1; font: 8px "DM Mono", monospace; }.transaction-metrics strong { display: block; margin-top: 8px; overflow: hidden; color: #2d3950; font-size: 14px; text-overflow: ellipsis; }
 .transaction-pattern { padding: 12px 14px; border-left: 3px solid var(--mint); border-radius: 4px; color: #66738a; background: #f7fbfa; font-size: 10px; line-height: 1.5; }
 .transaction-pattern strong { color: #354258; }.transaction-pattern .mapping { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }.transaction-pattern .mapping span { padding: 4px 6px; border-radius: 4px; color: #53647c; background: #eaf4f1; font: 8px "DM Mono", monospace; }
 .transaction-table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 9px; }.transaction-table-head strong, .transaction-table-head span { display: block; }.transaction-table-head strong { font-size: 12px; }.transaction-table-head span { margin-top: 4px; color: #929cab; font: 8px "DM Mono", monospace; }
 .transaction-table-wrap { max-height: 520px; overflow: auto; border: 1px solid #dfe4ee; border-radius: 7px; background: #fff; }
 .transaction-table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: nowrap; }.transaction-table th { position: sticky; top: 0; z-index: 1; padding: 9px 8px; color: #64728a; background: #f3f6fb; font: 8px "DM Mono", monospace; text-align: left; text-transform: uppercase; }.transaction-table td { padding: 8px; border-top: 1px solid #edf0f5; color: #4f5b70; }.transaction-table tbody tr:nth-child(even) { background: #fafbfe; }.transaction-table tbody tr:hover { background: #f1f5ff; }.transaction-table td:nth-last-child(-n+3), .transaction-table th:nth-last-child(-n+3) { text-align: right; font-family: "DM Mono", monospace; }.transaction-table .description-cell { min-width: 230px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.transaction-source { border: 0; background: transparent; color: var(--blue); font: 9px "DM Mono", monospace; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 650px) { .transaction-intro { align-items: flex-start; flex-direction: column; }.transaction-metrics { grid-template-columns: repeat(2, 1fr); }.transaction-table-wrap { max-height: 430px; } }
.library-actions { justify-content: flex-end; flex-wrap: wrap; max-width: 250px; }
.library-action { text-decoration: none; white-space: nowrap; }
.library-download { color: #347a67; background: #f3fbf8; border-color: #cfe9e1; }
.library-item { display: grid; grid-template-columns: 28px 34px minmax(0, 1fr); align-items: start; }
.library-select { grid-column: 1; grid-row: 1 / span 2; }
.book-cover { grid-column: 2; grid-row: 1 / span 2; }
.library-details { grid-column: 3; width: auto; }
.library-actions { grid-column: 3; width: auto; max-width: none; justify-content: flex-start; }
 .latex-display { min-height: 58px; margin: 5px 0 12px; padding: 16px 14px; overflow-x: auto; border: 1px solid #dfe6f4; border-radius: 7px; color: #24324d; background: linear-gradient(135deg, #fafbff, #f7faff); text-align: center; }
 .latex-display code { color: #33466d; font: 12px/1.6 "DM Mono", monospace; white-space: pre-wrap; }.latex-display.unavailable { color: #8d98a8; font-size: 11px; text-align: left; }
 .latex-display .katex-display { margin: 0; overflow: auto hidden; }.latex-display .katex { font-size: 1.08em; }
 .extracted-table-wrap { max-height: 330px; margin: 4px 0 12px; overflow: auto; border: 1px solid #dfe4ee; border-radius: 7px; background: #fff; }
 .extracted-table { width: 100%; border-collapse: collapse; color: #4f5c72; font-size: 10px; line-height: 1.35; }.extracted-table th, .extracted-table td { min-width: 72px; padding: 7px 8px; border: 1px solid #e7eaf0; vertical-align: top; text-align: left; }.extracted-table th { position: sticky; top: 0; z-index: 1; color: #394761; background: #f1f5fb; font-weight: 600; }.extracted-table tr:nth-child(even) td { background: #fafbfe; }
 @media (max-width: 650px) { .latex-display { padding-inline: 8px; }.latex-display .katex { font-size: .72em; } }
