:root {
  --app-bar-height: 48px;
  --tool-rail-width: 56px;
  --mobile-tabs-height: 58px;
  color-scheme: light;
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #dfe3e7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body { min-height: 100vh; margin: 0; background: #dfe3e7; }
button, input, select { font: inherit; }
button, .font-drop { cursor: pointer; }
button { border: 1px solid #c8ced4; border-radius: 8px; padding: 7px 11px; color: #17202a; background: #fff; }
button:hover:not(:disabled) { background: #edf1f4; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #72a7d4; outline-offset: 2px; }
button:disabled { cursor: default; opacity: .38; }
button[aria-busy="true"] { opacity: 1; }
.primary { color: #fff; background: #1f5f99; border-color: #1f5f99; }
.primary:hover:not(:disabled) { background: #194f80; }
.quiet { border-color: transparent; background: transparent; }
.danger { color: #9d2520; border-color: #e6d3d1; background: #fff; }
.danger:hover:not(:disabled) { border-color: #f0cbc8; background: #fdeceb; }
.row, .compact-row { display: flex; align-items: center; gap: 8px; }
.spacer, .grow, .rail-spacer { flex: 1; }
.error { color: #b42318; min-height: 1.3rem; }

.auth-card { width: min(390px, calc(100% - 32px)); margin: 11vh auto; padding: 30px; border-radius: 18px; background: #fff; box-shadow: 0 18px 55px #23354a25; }
.auth-mark, .brand { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; background: #1f5f99; font-weight: 800; }
.auth-card h1 { margin: 12px 0 4px; }
.login-hint { color: #586573; }
.auth-card form { display: grid; gap: 12px; margin-top: 22px; }
label, .control { display: grid; gap: 4px; color: #647180; font-size: 11px; font-weight: 650; letter-spacing: .02em; }
input, select { min-width: 0; height: 36px; border: 1px solid #c7ced5; border-radius: 7px; padding: 6px 8px; color: #17202a; background: #fff; }

.app-bar { position: fixed; z-index: 20; inset: 0 0 auto; height: var(--app-bar-height); display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid #cbd1d6; background: rgba(255,255,255,.97); box-shadow: 0 1px 8px #24313d10; }
.document-name { max-width: min(360px, 32vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-button { position: relative; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.transfer-button > span:first-child { font-size: 17px; line-height: 1; }
.font-drop input { display: none; }
.compact { padding-inline: 8px; }
.account-button { border-color: transparent; white-space: nowrap; }
.account-popover { position: fixed; z-index: 30; top: 43px; right: 10px; padding: 6px; border: 1px solid #c8ced4; border-radius: 9px; background: #fff; box-shadow: 0 8px 28px #24313d30; }
.account-popover button { width: 100%; border: 0; }

.tool-rail { position: fixed; z-index: 15; inset: var(--app-bar-height) auto 0 0; width: var(--tool-rail-width); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 5px; border-right: 1px solid #c7cdd3; background: #fff; }
.rail-tool { position: relative; width: 44px; min-height: 44px; display: grid; place-items: center; gap: 0; padding: 3px; border-color: transparent; font-size: 18px; background: transparent; }
.rail-tool[aria-expanded="true"] { color: #fff; background: #1f5f99; }
.rail-tool[aria-expanded="true"]:hover { background: #1f5f99; }
.rail-tool:is(#add-input, #add-output) > span { white-space: nowrap; font-size: 13px; font-weight: 750; }
.rail-tool small { display: none; font-size: 9px; font-weight: 650; }
.library-symbol > span { font-family: Georgia, serif; font-style: italic; font-weight: 700; }
.zoom-tool { min-height: 32px; }
.zoom-label { width: 48px; color: #586573; font-size: 11px; text-align: center; }

.page-area { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 22px; margin-left: var(--tool-rail-width); padding: calc(var(--app-bar-height) + 26px) 28px 66px; background: #dfe3e7; touch-action: pan-y; transform: translateX(calc(var(--canvas-pan, 0px) + var(--panel-shift, 0px))); cursor: grab; }
.page-area.panning { cursor: grabbing; }
.pdf-page { position: relative; flex: 0 0 auto; max-width: none; background: #fff; box-shadow: 0 4px 18px #23354a35; user-select: none; }
.page-image { width: 100%; height: 100%; display: block; pointer-events: none; }
.field-layer { position: absolute; inset: 0; }
.page-number { position: absolute; z-index: 2; top: 9px; left: 11px; display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; color: #52606d; background: #ffffffdf; font-size: 11px; font-weight: 700; }
.field { position: absolute; min-width: 8px; min-height: 8px; border-radius: 4px; box-shadow: 0 0 0 1px #2a72ad; cursor: move; overflow: visible; touch-action: none; }
.field.output { box-shadow: 0 0 0 1px #8a55a1; }
.field.output.unmapped { background: #ffe1e1 !important; border-color: #bd2929 !important; box-shadow: 0 0 0 2px #bd2929; }
.field.font-unavailable { border-color: #b86208 !important; box-shadow: 0 0 0 2px #b86208; }
.field.selected { outline: 3px solid #f39b25; outline-offset: 1px; z-index: 3; }
.selection-marquee { position: absolute; z-index: 5; border: 2px dashed #f39b25; border-radius: 3px; background: #f59e0b18; pointer-events: none; }
.field span { display: block; width: 100%; white-space: nowrap; }
.field-label { position: absolute; right: 0; left: 0; min-height: 0; cursor: move; font-kerning: none; }
.field-label[contenteditable="plaintext-only"] { cursor: text; }
.field-label:focus { outline: 2px solid #1f5f99; outline-offset: 1px; }
.reference-count, .mapping-warning { position: absolute; top: calc(var(--badge-size) / -2); right: calc(var(--badge-size) / -2); display: grid; place-items: center; min-width: var(--badge-size); height: var(--badge-size); padding: 0 3px; border: 1.5px solid #fff; border-radius: 99px; color: #fff; background: #1f5f99; font: 700 calc(var(--badge-size) * .56)/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.mapping-warning { background: #bd2929; }
.handle { position: absolute; right: -7px; top: 50%; width: 12px; height: 20px; border-radius: 3px; background: #f39b25; cursor: ew-resize; transform: translateY(-50%); }

.overlay-panel { position: fixed; z-index: 18; top: var(--app-bar-height); bottom: 0; left: var(--tool-rail-width); width: 300px; padding: 16px; border-right: 1px solid #bbc3ca; background: #fff; box-shadow: 8px 0 28px #24313d24; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.overlay-panel::-webkit-scrollbar { width: 0; }
.files-panel { width: min(430px, calc(100vw - var(--tool-rail-width))); }
.storage-summary { display: grid; gap: 8px; margin-bottom: 18px; padding: 12px; border-radius: 9px; background: #eef4f8; }
.storage-summary div { display: flex; justify-content: space-between; gap: 12px; color: #445565; font-size: 12px; font-weight: 700; }
.storage-summary progress { width: 100%; accent-color: #1f5f99; }
.file-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 10px; font-size: 11px; }
.file-sort button { padding: 5px 7px; font-size: 10px; }
.file-sort button.active { color: #fff; border-color: #1f5f99; background: #1f5f99; }
.file-list { display: grid; gap: 8px; }
.file-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 10px; border: 1px solid #d7dde2; border-radius: 9px; }
.file-entry.current { border-color: #1f5f99; box-shadow: inset 3px 0 #1f5f99; }
.file-open { display: flex; grid-column: 1; min-width: 0; justify-content: space-between; gap: 10px; width: 100%; padding: 0 10px 7px 0; border: 0; text-align: left; background: transparent; }
.file-open strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-open span { flex: 0 0 auto; color: #596979; font-size: 11px; }
.file-entry dl { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.file-entry dl div { min-width: 0; }
.file-entry dt { color: #74808b; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.file-entry dd { margin: 2px 0 0; font-size: 10px; }
.file-delete { grid-column: 2; grid-row: 1; align-self: start; padding: 5px 7px; font-size: 10px; }
.panel-head, .section-title { display: flex; align-items: center; gap: 8px; }
.panel-head { margin-bottom: 14px; }
.panel-head > div { display: grid; }
.panel-head small, .section-title { color: #66727e; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.panel-head strong { min-width: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.kind-pill { flex: 0 0 auto; padding: 3px 8px; border-radius: 99px; color: #1f5f99; background: #e7f0f8; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.kind-pill.output { color: #6d3f83; background: #f1e8f6; }
.rule { margin: 5px 0 0; border-top: 1px solid #e1e5e9; }
.close-panel { margin-left: auto; border-color: transparent; font-size: 20px; }
#inspector { display: grid; gap: 9px; }
.field-error { margin: 0 0 12px; padding: 10px; border: 2px solid #bd2929; border-radius: 7px; color: #8f1717; background: #ffe1e1; font-weight: 750; }
#field-source[aria-invalid="true"] { border-color: #bd2929; color: #9d1f1f; background: #fff0f0; }
.control-label { display: block; color: #647180; font-size: 11px; font-weight: 650; letter-spacing: .02em; }
#field-font { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 36px; padding: 6px 9px; overflow: hidden; text-align: left; }
#field-font > span:first-child { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#field-font > span:last-child { flex: 0 0 auto; }
.font-options { position: fixed; z-index: 30; min-width: 0; max-height: calc(100vh - 80px); padding: 4px; overflow: hidden auto; border: 1px solid #aeb9c3; border-radius: 7px; background: #fff; box-shadow: 0 10px 25px #24313d35; }
#font-search { position: sticky; left: 0; width: 100%; min-width: 220px; margin-bottom: 4px; }
.font-options button { display: block; width: 100%; min-height: 36px; padding: 8px; border: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; background: #fff; }
.font-options button:hover, .font-options button[aria-selected="true"] { color: #145c99; background: #e8f3fc; }
.empty-font { margin: 8px; color: #687582; font-size: 12px; }
.style-save { width: 100%; height: 40px; margin-top: 2px; color: #1f5f99; border-color: #b8cfe3; background: #f2f8fd; font-weight: 650; white-space: nowrap; }
.style-save:hover:not(:disabled) { background: #e6f1fa; }
.compact-row > label { min-width: 0; }
.size-control { width: 74px; }
.type-control { flex: 0 0 70px; min-width: 0; display: grid; gap: 4px; }
.type-group { display: flex; height: 36px; overflow: hidden; border: 1px solid #c7ced5; border-radius: 8px; background: #fff; }
.type-group button { flex: 1 1 0; padding: 0; border: 0; border-radius: 0; color: #52606d; background: transparent; }
.type-group button + button { border-left: 1px solid #dfe4e9; }
.type-group button:hover { background: #f2f6f9; }
.type-group button[aria-pressed="true"] { color: #1f5f99; background: #e7f0f8; }
.align-control { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; }
.align-group { display: flex; height: 36px; overflow: hidden; border: 1px solid #c7ced5; border-radius: 8px; background: #fff; }
.align-group button { flex: 1 1 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; color: #52606d; background: transparent; }
.align-group button + button { border-left: 1px solid #dfe4e9; }
.align-group button:hover { background: #f2f6f9; }
.align-group button[aria-checked="true"] { color: #1f5f99; background: #e7f0f8; }
.align-group svg, .border-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.align-group button:focus-visible { outline-offset: -3px; }
.swatch-row { align-items: end; gap: 6px; }
.swatch { flex: 1 1 0; min-width: 0; }
.swatch input { width: 100%; height: 36px; padding: 3px; border-radius: 8px; cursor: pointer; }
.swatch input::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input::-webkit-color-swatch { border: 1px solid #00000014; border-radius: 5px; }
.border-toggle { flex: 1 1 0; min-width: 0; display: grid; gap: 4px; }
.border-toggle button { display: grid; place-items: center; width: 100%; height: 36px; padding: 0; color: #52606d; }
.border-toggle button[aria-pressed="true"] { color: #1f5f99; border-color: #9dc0dd; background: #e7f0f8; }
.action-row { gap: 6px; }
.action-row button { flex: 1 1 0; min-width: 0; height: 40px; padding: 0; white-space: nowrap; }
.selection-hint { margin: 10px 0 16px; color: #687582; }
.panel-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid #e1e5e9; }
.panel-section.first-section { margin-top: 0; padding-top: 0; border-top: 0; }
.section-title { min-height: 30px; }
.section-title button { margin-left: auto; padding: 5px; color: #1f5f99; border: 0; font-size: 11px; font-weight: 750; letter-spacing: 0; }
.chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.empty-style { grid-column: 1 / -1; margin: 3px 0; color: #687582; font-size: 12px; }
.style { position: relative; min-width: 0; }
.style > .style-apply { position: relative; display: grid; align-content: center; gap: 1px; width: 100%; min-height: 44px; padding: 5px 26px 5px 6px; overflow: hidden; border-color: #d1d7dc; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.style > .style-apply small { overflow: hidden; font: 10px/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-overflow: ellipsis; white-space: nowrap; opacity: .72; }
.style-count { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; color: #fff; background: #2563eb; font: 700 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.style-count[data-kind="output"] { background: #16a34a; }
.style > .delete-style { position: absolute; top: 1px; right: 1px; padding: 1px 5px; border: 0; color: #8b3330; background: #fffffff0; }
.style > .style-apply.selected { border: 2px solid #1f5f99; }
.font-drop { display: grid; place-items: center; min-height: 150px; padding: 18px; border: 2px dashed #7da8ca; border-radius: 11px; color: #536473; background: #f3f8fc; text-align: center; }
.font-drop strong { color: #1f5f99; font-size: 16px; }
.font-drop.dragging { border-color: #1f5f99; background: #e5f2fc; }
.font-library { display: grid; gap: 7px; margin-top: 8px; }
.font-group { display: grid; gap: 7px; }
.font-group + .font-group { margin-top: 12px; }
.font-entry { position: relative; min-height: 52px; padding: 8px 36px 8px 9px; border: 1px solid #d1d7dc; border-radius: 7px; overflow: hidden; background: #fff; }
.font-entry span, .font-entry small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-entry small { font: 10px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; opacity: .68; }
.font-entry.unusable { border-color: #d69730; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
.font-warning { display: flex; gap: 5px; margin-top: 5px; color: #8a4b08; font: 10px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; white-space: normal; }
.font-warning b { display: grid; flex: 0 0 15px; place-items: center; height: 15px; border-radius: 50%; color: #fff; background: #b86208; }
.font-entry button { position: absolute; top: 5px; right: 5px; padding: 3px 6px; border: 0; color: #8b3330; background: transparent; }
.page-jump { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.page-jump button { position: relative; aspect-ratio: .72; padding: 0; overflow: hidden; border-color: #ccd2d8; color: #52606d; background: #f5f7f8; font-size: 12px; font-weight: 750; }
.page-jump img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.page-jump span { position: absolute; top: 5px; left: 5px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #ffffffe8; pointer-events: none; }
.status-pill { position: fixed; z-index: 20; right: 17px; bottom: 15px; display: flex; gap: 7px; max-width: calc(100vw - 100px); padding: 8px 11px; border: 1px solid #c6ccd2; border-radius: 99px; color: #52606d; background: #fffffff2; box-shadow: 0 4px 15px #24313d22; font-size: 12px; }
.status-pill button { padding: 0 0 0 7px; border: 0; border-left: 1px solid #c6ccd2; border-radius: 0; color: #145c99; background: transparent; font-weight: 750; }
.style-dialog { width: min(360px, calc(100% - 28px)); padding: 18px; border: 1px solid #c1c8ce; border-radius: 14px; box-shadow: 0 18px 60px #17202a55; }
.style-dialog::backdrop { background: #17202a55; backdrop-filter: blur(2px); }
.style-dialog form { display: grid; gap: 13px; }
.style-preview { min-height: 74px; display: grid; place-items: center; padding: 12px; border-radius: 9px; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.selection-summary { margin: 0; color: #66727e; font-size: 13px; }
.action-row { flex-wrap: wrap; }
.action-row #copy-to-pages { flex-basis: 100%; }
.clipboard-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding-top: 9px; border-top: 1px solid #e0e4e8; }
.clipboard-row small { color: #66727e; font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.copy-pages-dialog { width: min(650px, calc(100% - 28px)); }
.copy-pages-help { margin: -7px 0 0; color: #66727e; font-size: 13px; }
.copy-page-thumbnails { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 7px; max-height: min(52vh, 430px); overflow-y: auto; padding: 2px; }
.copy-page-thumbnail { position: relative; min-width: 0; aspect-ratio: 595 / 842; padding: 0; overflow: hidden; border: 1px solid #c8cfd5; border-radius: 4px; color: #66727e; background: #fff; }
.copy-page-thumbnail img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.copy-page-thumbnail.source { border-style: dashed; background: #edf0f2; opacity: .76; }
.copy-page-thumbnail.selected { border-color: #f39b25; box-shadow: inset 0 0 0 2px #f59e0b55; }
.copy-page-thumbnail > b { position: absolute; z-index: 4; left: 3px; bottom: 3px; padding: 2px 4px; border-radius: 3px; background: #ffffffe8; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy-page-thumbnail > i { position: absolute; z-index: 4; right: 3px; bottom: 3px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; color: #fff; background: #f39b25; font: 800 11px/1 sans-serif; }
.copy-page-preview { position: absolute; inset: 0; container-type: inline-size; pointer-events: none; }
.copy-preview-field { position: absolute; min-width: 1px; min-height: 1px; overflow: hidden; white-space: nowrap; border-radius: 1px; }
.copy-preview-field.proposed { outline: 1px dashed #7c3aed; outline-offset: -1px; opacity: .72; box-shadow: 0 0 0 1px #ffffff88; }
.copy-preview-field.proposed.input { outline-color: #2b6cb0; }
.copy-page-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.copy-page-quick button { padding: 5px 10px; border-radius: 99px; font-size: 12px; }
.dialog-grab { display: none; }
.pdf-choice { display: grid; gap: 3px; text-align: left; }
.pdf-choice span { color: #66727e; font-size: 12px; }
.pdf-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.spinner { flex: 0 0 auto; display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.transfer-bar { position: fixed; z-index: 25; inset: var(--app-bar-height) 0 auto; height: 3px; overflow: hidden; background: #ccd7e2; }
.transfer-bar i { display: block; width: var(--progress, 0%); height: 100%; background: #1f5f99; transition: width .18s ease; }
.transfer-bar.indeterminate i { width: 38%; animation: sweep 1.1s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-105%); } to { transform: translateX(268%); } }
.pdf-drop { position: fixed; z-index: 16; inset: var(--app-bar-height) 0 0 var(--tool-rail-width); display: grid; place-items: center; padding: 24px; background: #dfe3e7; }
.pdf-drop.dragging { background: #1f5f9926; }
.pdf-drop-card { width: min(460px, 100%); gap: 7px; padding: 34px 26px; border-radius: 14px; box-shadow: 0 10px 30px #23354a1a; }
.pdf-drop.dragging .pdf-drop-card { border-color: #1f5f99; background: #e5f2fc; }
.pdf-drop-mark, .pdf-drop-spinner { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 4px; border-radius: 12px; color: #fff; background: #1f5f99; font-size: 19px; }
.pdf-drop-spinner { width: 30px; height: 30px; border-width: 3px; border-color: #1f5f99; border-top-color: transparent; border-radius: 50%; background: transparent; }
.pdf-drop-card strong { font-size: 19px; }
.pdf-drop-card:disabled { opacity: 1; }

@media (max-width: 720px) {
  body.panel-open { overflow: hidden; }
  .app-bar { padding: 0 8px; }
  .brand { width: 27px; }
  .document-name { max-width: min(34vw, 160px); }
  .app-bar .compact { display: none; }
  .account-button { width: 34px; padding-inline: 6px; font-size: 0; }
  .account-button::after { content: "•••"; font-size: 15px; }
  .transfer-button { padding-inline: 9px; }
  .transfer-button > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pdf-drop { inset: var(--app-bar-height) 0 var(--mobile-tabs-height) 0; padding: 14px; }
  .pdf-drop-card { padding: 26px 18px; }
  .tool-rail { inset: auto 0 0; width: auto; height: var(--mobile-tabs-height); flex-direction: row; justify-content: space-around; gap: 0; padding: 3px 5px; border: 0; border-top: 1px solid #c7cdd3; }
  .rail-spacer, #fit { display: none; }
  .zoom-label { display: block; width: 38px; }
  .zoom-tool { display: grid; width: 34px; }
  .rail-tool { width: 44px; min-height: 48px; font-size: 16px; }
  .rail-tool small { display: block; }
  .page-area { min-height: 100vh; gap: 14px; margin-left: 0; padding: calc(var(--app-bar-height) + 12px) 8px calc(var(--mobile-tabs-height) + 45px); }
  .overlay-panel { inset: auto 0 var(--mobile-tabs-height); width: auto; max-height: min(420px, calc(100vh - var(--app-bar-height) - var(--mobile-tabs-height))); padding: 12px 14px 16px; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px #24313d38; }
  .overlay-panel::before { content: ""; display: block; width: 42px; height: 4px; margin: -3px auto 10px; border-radius: 3px; background: #bdc4ca; }
  .pages-panel { max-height: 55vh; }
  .page-jump { grid-template-columns: repeat(4, 1fr); }
  .status-pill { right: 8px; bottom: calc(var(--mobile-tabs-height) + 8px); }
  .copy-pages-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 28px); margin: 0; padding: 12px 14px 16px; overflow: auto; border: 0; border-radius: 18px 18px 0 0; }
  .copy-pages-dialog form { max-height: none; }
  .dialog-grab { display: block; width: 42px; height: 4px; margin: -3px auto 1px; border-radius: 3px; background: #bdc4ca; }
  .copy-page-thumbnails { grid-template-columns: repeat(4, 1fr); max-height: min(48vh, 390px); }
  .align-group, .type-group, .border-toggle button, .swatch input { height: 42px; }
  .action-row button, .style-save { height: 44px; }
  .handle { width: 20px; height: 28px; right: -11px; }
}
