.main-shell {
  width: min(1072px, calc(100% - 48px));
  margin-inline: auto;
  flex: 1 0 auto;
  padding-block: 50px 64px;
}
.main-shell :is(h1, h2, h3, p) { margin: 0; }
.main-shell :is(h1, h2, h3) { color: var(--ink); line-height: 1.13; font-weight: 680; }
.main-shell h2 { font-size: 25px; letter-spacing: -.03em; }
.main-shell h3 { font-size: 16px; letter-spacing: -.014em; }
.main-shell strong { font-weight: 640; }
.main-shell :is(button, select, input) { font-family: inherit; }
.main-shell button { cursor: pointer; }
.main-shell button:disabled { cursor: not-allowed; }
.main-shell :is(button, a, select) { touch-action: manipulation; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }

.intro { display: grid; grid-template-columns: 1fr minmax(230px, .75fr); align-items: end; gap: 40px; }
.intro h1 { font-size: 48px; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.intro p { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 45ch; }
.mode-nav { display: flex; align-items: stretch; gap: 8px; margin-block: 30px 32px; border-bottom: 1px solid var(--line-strong); }
.mode-button, .btn, .icon-btn, .link-button, .quick-button, .tool-button { border: 0; background: transparent; }
.mode-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 9px; min-height: 46px; padding: 8px 15px;
  color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.mode-button[aria-current="page"] { color: var(--blue-hover); }
.mode-button[aria-current="page"]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--blue); }
.mode-button:hover, .tool-button:hover, .icon-btn:hover { background: var(--background); color: var(--ink); }
.desk-grid { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-panel); }
.work-panel { min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-block: 6px 0; }
.panel-heading p { margin-top: 7px; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 45ch; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23px minmax(0, 1fr); align-items: end; gap: 8px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.field :is(input, select) {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-small); background: var(--paper);
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.field input::placeholder { color: var(--muted); }
.field input[type="color"] { padding: 5px; }
.field select:disabled { color: var(--muted); background-color: var(--background); opacity: 1; }
.route-arrow { display: grid; height: 44px; place-items: center; color: var(--muted); }
.dropzone {
  display: grid; justify-items: center; align-content: center; gap: 16px; text-align: center;
  min-height: 171px; padding: 18px; border: 1px dashed var(--fold);
  border-radius: var(--r-panel); background: var(--background);
}
.dropzone.is-over { background: var(--tint); border-color: var(--blue); }
.drop-copy strong { display: block; font-size: 16px; }
.drop-copy p { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--muted); text-wrap: balance; }
.dropzone.is-compact { display: flex; align-items: center; justify-content: space-between; text-align: start; min-height: 50px; padding: 8px 12px; gap: 10px; }
.is-compact .drop-copy strong { font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hint input[type="checkbox"] { width: 15px; height: 15px; margin: 0 5px 0 0; vertical-align: -.15em; accent-color: var(--blue); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--r-small);
  font-weight: 600; font-size: 14px; line-height: 1.3; text-decoration: none;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:not(:disabled):hover { background: var(--blue-hover); }
.btn-secondary { background: var(--paper); border-color: var(--line-strong); color: var(--blue-hover); }
.btn-secondary:not(:disabled):hover { background: var(--tint); border-color: var(--fold); }
.btn-primary:disabled { color: var(--muted); background: var(--background); border-color: var(--line); opacity: 1; }
.link-button { min-height: 30px; padding: 0; color: var(--blue-hover); font-size: 13px; font-weight: 600; text-underline-offset: 3px; }
.link-button:not(:disabled):hover { text-decoration: underline; }
.link-button.danger { color: var(--danger); }
.carry-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.carry-list .link-button { display: inline-flex; align-items: center; gap: 6px; text-align: start; }
.work-actions { display: grid; justify-items: start; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.full-action { min-width: 145px; }
.privacy { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.privacy .icon { width: 15px; height: 15px; color: var(--green); }

.preview-panel { display: flex; flex-direction: column; overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.preview-head h2 { flex: 0 0 auto; font-size: 16px; letter-spacing: -.015em; }
.preview-head .file-name { color: var(--muted); font-size: 13px; text-align: right; }
.preview-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 310px; padding: 22px; background: var(--background); }
.preview-foot { min-height: 44px; padding: 5px 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.preview-foot .icon { width: 15px; height: 15px; }
.doc-paper { position: relative; width: min(100%, 300px); margin-inline: auto; aspect-ratio: var(--ratio, .7071); background: var(--paper); box-shadow: var(--shadow-paper); }
.sample-paper { width: min(100%, 228px); display: flex; flex-direction: column; color: var(--ink); padding: 24px 20px 15px; line-height: 1.4; }
.sample-paper small { color: var(--muted); font-size: 8.5px; }
.sample-meta { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sample-emblem { font-size: 9px; font-weight: 660; color: var(--blue-hover); }
.sample-paper h3 { font-size: 20px; margin-top: 16px; letter-spacing: -.035em; }
.sample-paper p { margin-top: 8px; font-size: 9px; line-height: 1.6; }
.sample-table { margin-top: 16px; width: 100%; border-collapse: collapse; text-align: left; font-size: 8px; font-variant-numeric: tabular-nums; }
.sample-table th, .sample-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.sample-table th { background: var(--tint); }
.sample-table :is(th,td):last-child { text-align: right; white-space: nowrap; }
.sample-sign { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.page-image { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: contain; transform: translate(-50%, -50%) rotate(var(--angle, 0deg)); }
.page-image.quarter { width: calc(100% * var(--original-ratio)); height: calc(100% / var(--original-ratio)); }
.doc-paper.is-tool { cursor: crosshair; user-select: none; }
.doc-paper.is-highlight { touch-action: none; }
.doc-paper.is-tool:focus-visible { outline-offset: 5px; }
.page-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; container-type: inline-size; }
.overlay { position: absolute; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.2; }
.overlay-image { object-fit: contain; object-position: top left; }
.overlay-highlight { opacity: .36; }
.overlay-text { overflow: hidden; font-family: var(--annotation-font); }
.annotation-layer { z-index: 3; }
.overlay.is-movable { pointer-events: auto; cursor: move; touch-action: none; user-select: none; }
.overlay.is-movable:hover { outline: 1px dashed var(--blue); outline-offset: 1px; }
.overlay.is-selected, .overlay.is-movable:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.overlay-handle { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--paper); border-radius: 3px; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); cursor: nwse-resize; pointer-events: auto; touch-action: none; }
.page-buttons { display: flex; gap: 4px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-bg); }
.file-list { list-style: none; display: grid; padding: 0; margin: 0; max-height: 269px; overflow-y: auto; border-top: 1px solid var(--line); }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.list-head strong { font-size: 13px; }
.file-row { display: flex; gap: 7px; align-items: center; min-width: 0; min-height: 48px; padding: 5px 5px 5px 9px; border-bottom: 1px solid var(--line); background: var(--paper); }
.file-row[data-active="true"] { background: var(--tint); }
.file-row.drag-target { border-color: var(--blue); background: var(--tint); }
.file-name, .row-select { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main { min-width: 0; flex: 1; }
.row-select { display: block; background: none; border: 0; text-align: left; padding: 1px 0; width: 100%; font-size: 13px; font-weight: 650; color: var(--ink); }
.row-select:hover { color: var(--blue); }
.row-meta { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }
.row-tools { display: flex; gap: 1px; }
.row-index { color: var(--muted); font-size: 12px; min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.drag-handle { color: var(--muted); cursor: grab; }
.drag-handle .icon { width: 15px; height: 15px; }
.row-thumb { display: block; width: 27px; height: 31px; object-fit: contain; border: 1px solid var(--line); border-radius: 3px; background: var(--background); }
.format-mark { min-width: 37px; padding: 2px 4px; border-radius: 5px; display: inline-block; text-align: center; background: var(--tint); color: var(--blue-hover); font-size: 10px; font-weight: 760; line-height: 1.5; }
.editor-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-button { display: inline-flex; align-items: center; gap: 5px; min-height: 35px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 640; }
.tool-button .icon { width: 15px; height: 15px; }
.tool-button[aria-pressed="true"] { background: var(--tint); color: var(--blue-hover); border-color: var(--fold); }
.inline-fields { display: grid; grid-template-columns: minmax(0, 1fr) 68px; gap: 8px; }
.inline-fields.three { grid-template-columns: minmax(0, 1fr) 72px 68px; }
.tool-config { display: grid; gap: 8px; }
.message { border-radius: var(--r-small); padding: 8px 10px; font-size: 13px; background: var(--tint); color: var(--ink); }
.message.error { background: var(--danger-bg); color: var(--danger); }
.result { display: grid; gap: 8px; border-radius: 9px; padding: 12px; background: var(--green-bg); color: var(--green); }
.result strong { display: flex; gap: 5px; align-items: center; font-size: 14px; }
.result-row { display: flex; gap: 9px; align-items: center; justify-content: space-between; }
.result-file { min-width: 0; font-size: 12px; }
.result-file span { display: block; }
.empty-preview { display: grid; gap: 10px; justify-items: center; max-width: 32ch; text-align: center; color: var(--muted); font-size: 13px; }
.empty-preview .icon { width: 28px; height: 28px; color: var(--blue); }
.preview-image { max-width: 100%; max-height: 400px; width: auto; height: auto; object-fit: contain; box-shadow: var(--shadow-paper); }
.preview-sheet { align-self: center; justify-self: stretch; margin: 0; padding: 13px; overflow: auto; max-height: 350px; border-radius: 8px; background: var(--paper); box-shadow: var(--shadow-paper); }
.preview-sheet p { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.preview-sheet table { width: 100%; min-width: calc(var(--columns) * 64px); table-layout: fixed; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.preview-sheet td { padding: 6px 8px; border: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.preview-sheet tr:nth-child(odd) { background: var(--background); }
.preview-text { width: min(100%, 320px); min-height: 230px; max-height: 350px; overflow: auto; padding: 24px; line-height: 1.5; font-size: 13px; background: var(--paper); box-shadow: var(--shadow-paper); }
.preview-text p + p { margin-top: 7px; }
.quick-zone { margin-top: 44px; padding-top: 19px; border-top: 1px solid var(--ink); }
.quick-zone h2 { margin-bottom: 14px; font-size: 18px; letter-spacing: -.025em; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.quick-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 3px 10px 0; min-height: 40px; border-bottom: 1px solid var(--line); text-align: left; color: var(--blue-hover); font-size: 14px; font-weight: 600; }
.quick-button:hover { color: var(--blue); border-color: var(--blue); }
.quick-button .icon { width: 14px; height: 14px; }

@media (max-width: 860px) {
  .main-shell { padding-block: 33px 45px; }
  .intro { grid-template-columns: 1fr; gap: 9px; }
  .intro h1 { font-size: 38px; }
  .intro p { max-width: 65ch; }
  .desk-grid { gap: 24px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
}
@media (max-width: 740px) {
  .main-shell { width: calc(100% - 36px); padding-block: 27px 34px; }
  .intro h1 { font-size: 35px; }
  .intro p { font-size: 15px; }
  .mode-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-block: 18px 22px; }
  .mode-button { flex-direction: column; gap: 4px; padding: 7px 1px; font-size: 12px; line-height: 1.22; white-space: normal; }
  .mode-button .icon { width: 17px; height: 17px; }
  .desk-grid { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .work-panel { padding: 0; gap: 16px; }
  .panel-heading p { font-size: 14px; }
  .dropzone { min-height: 145px; gap: 13px; }
  .preview-head { min-height: 44px; padding-inline: 13px; }
  .preview-stage { min-height: 232px; padding: 16px; }
  .sample-paper { width: min(100%, 215px); padding: 17px; }
  .quick-zone { margin-top: 30px; }
  .file-row { gap: 5px; }
  .file-row[data-list] .row-select, .preview-head .file-name, .result-file .file-name {
    white-space: pre-wrap; overflow-wrap: anywhere; text-overflow: clip;
  }
  .row-tools .icon-btn { width: 32px; min-height: 36px; }
  .result-row .btn { flex-shrink: 0; }
}
@media (max-width: 420px) {
  .file-row[draggable] {
    display: grid; grid-template-columns: max-content max-content max-content minmax(0, 1fr); row-gap: 0;
  }
  .file-row[draggable] .row-tools { grid-column: 2 / -1; justify-self: end; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .mode-button, .dropzone, .quick-button, .icon-btn { transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out; }
}

.main-shell.editor-open { width: min(1320px, 100% - 48px); padding-top: 14px; }
.editor-open .intro { display: none; }
.editor-open .mode-nav { margin-block: 0 18px; }
.editor-workspace { overflow: hidden; }
.editor-workspace.is-over { outline: 2px solid var(--blue); outline-offset: 2px; }
.editor-header, .editor-toolbar, .editor-view-head, .editor-view-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.editor-header { min-width: 0; min-height: 68px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.editor-document { display: flex; align-items: center; min-width: 0; gap: 10px; }
.editor-document-info { min-width: 0; }
.editor-file-icon { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 40px; border-radius: 6px; background: var(--tint); color: var(--blue-hover); }
.editor-file-icon .icon { width: 23px; height: 23px; }
.editor-document h1 { font-size: 18px; letter-spacing: -.02em; }
.editor-document p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.editor-actions { display: flex; flex-shrink: 0; gap: 6px; }
.editor-actions .icon { width: 16px; height: 16px; }
.editor-toolbar { min-height: 51px; padding: 7px 18px; border-bottom: 1px solid var(--line); }
.editor-toolbar .editor-tools { gap: 6px; }
.editor-toolbar .tool-button { border-color: transparent; }
.editor-toolbar .tool-button[aria-pressed="true"] { border-color: transparent; }
.editor-zoom { display: flex; align-items: center; white-space: nowrap; gap: 6px; color: var(--muted); font-size: 12px; }
.editor-zoom select { min-height: 33px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-small); padding: 4px 6px; color: var(--ink); }
.editor-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 44px; padding: 5px 18px; background: var(--background); border-bottom: 1px solid var(--line); }
.editor-context > .message { flex-basis: 100%; }
.editor-context .hint { font-size: 13px; }
.editor-tool-form, .line-formatting, .format-group, .replacement-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-tool-form .field input { min-height: 34px; }
.editor-tool-form .inline-fields { width: min(100%, 360px); align-items: end; }
.editor-tool-form .field input[type="color"] { min-width: 42px; }
.line-formatting { gap: 6px 12px; }
.format-group { gap: 2px; padding-inline-end: 10px; border-inline-end: 1px solid var(--line); }
.format-button { display: inline-grid; place-items: center; width: 34px; min-height: 34px; padding: 3px; }
.format-button .icon { width: 17px; height: 17px; }
.editor-font-label { max-width: 160px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.replacement-actions .btn { min-height: 33px; padding-block: 4px; }
.editor-body { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.editor-pages { min-width: 0; max-height: 710px; overflow: auto; border-right: 1px solid var(--line); padding: 14px 9px; background: var(--paper); }
.editor-pages h3 { font-size: 12px; color: var(--muted); padding-inline: 4px; margin-bottom: 9px; }
.editor-pages ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.editor-thumb { display: grid; justify-items: center; gap: 4px; width: 100%; min-width: 58px; padding: 5px; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.editor-thumb[aria-current="page"], .editor-thumb:hover { background: var(--tint); color: var(--blue-hover); }
.editor-thumb[aria-current="page"] { border-color: var(--fold); }
.editor-thumb img { display: block; width: 66px; height: 83px; object-fit: contain; user-select: none; }
.editor-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor-view-head, .editor-view-foot { min-height: 39px; padding: 4px 12px; color: var(--muted); font-size: 12px; }
.editor-view-head { font-weight: 600; border-bottom: 1px solid var(--line); }
.editor-view-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.editor-view-foot > .link-button { justify-self: end; }
.editor-pagination { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.editor-canvas { height: clamp(440px, 63vh, 650px); overflow: auto; background: var(--background); overscroll-behavior: contain; }
.editor-canvas:focus-visible { outline-offset: -2px; }
.editor-paper-wrap { display: flex; justify-content: center; align-items: start; width: max-content; min-width: 100%; min-height: 100%; padding: 24px; }
.doc-paper.editor-paper { --fit-width: min(var(--editor-width), max(250px, 100vw - 230px)); flex: 0 0 auto; width: calc(var(--fit-width) * var(--zoom)); }
.editor-text-targets { position: absolute; inset: 0; overflow: hidden; pointer-events: none; container-type: inline-size; }
.editor-line { position: absolute; pointer-events: auto; padding: 0; border: 0; background: transparent; cursor: text; }
.editor-line:focus-visible { z-index: 1; outline: none; box-shadow: inset 0 -1px var(--blue); }
.editor-flow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; container-type: inline-size; }
.editor-flow-slice { position: absolute; left: 0; width: 100%; overflow: hidden; }
.editor-flow-slice img { position: absolute; left: 0; width: 100%; height: calc(100cqw / var(--ratio)); }
.editor-text-change, .editor-text-mask, .inline-line-editor { position: absolute; }
.editor-text-mask { background: var(--erase-color); box-shadow: 0 0 0 .5px var(--erase-color); }
.inline-line-editor { z-index: 2; pointer-events: auto; }
.editor-run {
  position: absolute; left: 0; top: 0; width: var(--run-width);
  font-family: var(--paragraph-font, var(--annotation-font)); font-size: var(--run-font); line-height: var(--run-leading);
}
[data-rotated] > .editor-run {
  left: 50%; top: 50%; height: var(--run-height); transform: translate(-50%, -50%) rotate(var(--run-angle));
}
.editor-run > span, .inline-line-editor textarea {
  display: block; width: 100%; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;
}
.inline-line-editor textarea {
  margin: 0; padding: 0; border: 0; border-radius: 0; outline: none;
  resize: none; overflow: hidden; background: transparent; color: inherit;
  font: inherit; text-align: inherit; caret-color: var(--blue-hover);
}
.inline-line-editor textarea[wrap="off"] { white-space: pre; }
.editor-changes { position: relative; width: fit-content; }
.editor-changes summary { cursor: pointer; color: var(--blue-hover); font-weight: 640; white-space: nowrap; }
.editor-changes summary span { color: var(--muted); }
.editor-changes-list {
  position: absolute; z-index: 4; left: 0; bottom: calc(100% + 8px); width: min(285px, 80vw);
  padding: 8px; border-radius: var(--r-small); background: var(--paper); box-shadow: var(--shadow-paper);
}
.editor-changes .file-row { min-height: 38px; }
.editor-changes .file-name { font-size: 12px; }
:is(#desk:fullscreen, #desk.editor-expanded) { width: 100%; height: 100dvh; background: var(--paper); overflow: auto; }
#desk.editor-expanded { position: fixed; inset: 0; z-index: 10; }
body.editor-body-locked { overflow: hidden; }
:is(#desk:fullscreen, #desk.editor-expanded) .editor-workspace { min-height: 100%; display: flex; flex-direction: column; border: 0; border-radius: 0; }
:is(#desk:fullscreen, #desk.editor-expanded) .editor-body { flex: 1; }
:is(#desk:fullscreen, #desk.editor-expanded) .editor-canvas { height: max(440px, 100dvh - 233px); }
:is(#desk:fullscreen, #desk.editor-expanded) .editor-paper { --fit-width: min(var(--editor-width) * 1.18, max(250px, 100vw - 188px)); }
:is(#desk:fullscreen, #desk.editor-expanded) .editor-pages { max-height: calc(100dvh - 150px); }
@media (max-width: 940px) {
  .editor-body { grid-template-columns: 82px minmax(0, 1fr); }
  .editor-thumb img { width: 49px; height: 64px; }
  .doc-paper.editor-paper { --fit-width: min(var(--editor-width), max(225px, 100vw - 180px)); }
}
@media (max-width: 720px) {
  .main-shell.editor-open { width: calc(100% - 28px); padding-top: 12px; }
  .editor-header, .editor-toolbar { align-items: start; flex-wrap: wrap; padding: 9px 10px; gap: 8px; }
  .editor-document { max-width: 100%; }
  .editor-document .file-name { white-space: pre-wrap; overflow-wrap: anywhere; text-overflow: clip; }
  .editor-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .editor-actions .btn { min-height: 35px; font-size: 11px; padding-inline: 7px; }
  .editor-actions .icon { width: 13px; height: 13px; }
  .editor-toolbar .editor-tools { gap: 4px; }
  .editor-toolbar .tool-button { min-height: 36px; padding-inline: 6px; font-size: 12px; }
  .editor-toolbar .tool-button .icon { width: 14px; height: 14px; }
  .editor-context { padding-inline: 10px; }
  .editor-context .format-button { width: 36px; min-height: 36px; }
  .editor-font-label { display: none; }
  .editor-body { display: flex; flex-direction: column; }
  .editor-pages { display: flex; align-items: center; gap: 4px; max-height: 84px; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-pages[data-single="true"] { display: none; }
  .editor-pages h3 { margin-bottom: 0; }
  .editor-pages ol { display: flex; gap: 4px; }
  .editor-thumb { min-width: 34px; min-height: 36px; padding: 3px; }
  .editor-thumb img { width: 26px; height: 30px; }
  .editor-view-head { min-height: 33px; }
  .editor-view-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding-inline: 8px; font-size: 12px; }
  .editor-view-foot > div:first-child:empty { display: none; }
  .editor-view-foot .link-button { font-size: 11px; }
  .editor-pagination { justify-content: center; }
  .editor-pagination .icon-btn { width: 26px; }
  .editor-paper-wrap { padding: 13px; }
  .editor-canvas { height: clamp(340px, 58vh, 550px); }
  .doc-paper.editor-paper, :is(#desk:fullscreen, #desk.editor-expanded) .editor-paper { --fit-width: min(var(--editor-width), 100vw - 56px); }
  :is(#desk:fullscreen, #desk.editor-expanded) .editor-canvas { height: clamp(340px, 64dvh, 640px); }
}
