:root {
  --blue: #2563eb;
  --blue-dark: #1749b4;
  --blue-soft: #e9f0ff;
  --ink: #16181d;
  --muted: #646b75;
  --line: #d2d6dc;
  --shell: #f5f6f8;
  --workspace: #d9dce2;
  --paper: #fff;
  --yellow: #ffb84d;
  --green: #2d8f70;
  --red: #b54745;
  --paper-width: 816px;
  --paper-min-height: 1056px;
  --paper-pad-x: 96px;
  --paper-pad-y: 96px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--shell); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.45; }
body.editing-document { overflow: hidden; }
body.editing-document .desktop-footer { display: none !important; }
button, input, select { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.site-nav { display: flex; width: min(1420px, calc(100% - 48px)); height: 100%; margin: 0 auto; align-items: center; justify-content: space-between; }
.site-nav .brand { display: inline-flex; align-items: center; gap: 10px; color: #191c18; font-size: 19px; font-weight: 950; letter-spacing: -.03em; text-decoration: none; }
.site-nav nav { display: flex; align-items: center; gap: 24px; }
.site-nav nav a { color: #191c18; font-size: 14px; font-weight: 800; text-decoration: none; }
.site-nav .nav-pill { padding: 9px 16px; border: 2px solid #191c18; border-radius: 999px; background: #fff; }

.desktop-gate { display: none; }
.desktop-app { min-height: 760px; }
.eyebrow { color: var(--blue-dark); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }

.start-screen { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 54px 0 88px; }
.start-heading { max-width: 800px; margin: 0 auto; text-align: center; }
.start-heading h1 { margin: 12px 0 14px; font-size: clamp(38px, 4vw, 56px); line-height: 1.04; letter-spacing: -.052em; }
.start-heading p { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 18px; }

.open-card { max-width: 880px; margin: 38px auto 0; padding: 20px; border: 1px solid #9ea5ae; border-radius: 2px; background: #fff; box-shadow: 8px 8px 0 #1c2025; }
.file-drop { display: flex; min-height: 166px; align-items: center; justify-content: center; gap: 20px; padding: 30px; border: 1px dashed #929aa5; border-radius: 0; background: #f8f9fb; cursor: pointer; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.file-drop:focus-within { outline: 3px solid rgba(58, 122, 254, .22); outline-offset: 3px; }
.file-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.open-icon { display: grid; width: 62px; height: 62px; flex: 0 0 62px; place-items: center; border: 1px solid var(--blue-dark); border-radius: 2px; background: var(--blue); color: #fff; box-shadow: 4px 4px 0 #172a50; }
.open-icon svg { width: 30px; height: 30px; }
.file-drop strong, .file-drop small { display: block; }
.file-drop strong { font-size: 21px; letter-spacing: -.02em; }
.file-drop small { max-width: 500px; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.start-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.positioning-line { margin: 13px 0 0; color: var(--ink); font-size: 11px; font-weight: 700; text-align: center; }
.primary-action, .secondary-action, .danger-action { min-height: 40px; padding: 9px 16px; border-radius: 2px; font-size: 13px; font-weight: 800; cursor: pointer; }
.primary-action { border: 1px solid var(--blue); background: var(--blue); color: #fff; box-shadow: 0 5px 15px rgba(58, 122, 254, .18); }
.primary-action:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.secondary-action { border: 1px solid #c8d1dc; background: #fff; color: var(--ink); }
.secondary-action:hover { background: #f3f6fa; }
.danger-action { border: 1px solid var(--red); background: var(--red); color: #fff; }
.open-status { margin: 15px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.version-note { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 9px; margin: 12px auto 0; padding: 7px 10px; border-top: 1px solid #d8e3f6; background: #fff; color: var(--muted); font-size: 10px; }
.version-note strong { color: var(--blue-dark); }

.recent-section { max-width: 850px; margin: 40px auto 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.03em; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--blue-dark); font-size: 12px; font-weight: 750; cursor: pointer; }
.recent-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.recent-item { display: block; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.recent-item:hover { border-color: #9bb9f7; box-shadow: 0 8px 22px rgba(31, 41, 55, .07); }
.recent-item strong, .recent-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item strong { font-size: 14px; }
.recent-item span { margin-top: 5px; color: var(--muted); font-size: 10px; }

.start-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 52px; }
.start-trust article { padding: 20px 4px 0; border-top: 1px solid var(--line); }
.start-trust article > span { color: var(--blue-dark); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.start-trust h2 { margin: 9px 0 5px; font-size: 16px; }
.start-trust p { margin: 0; color: var(--muted); font-size: 12px; }

.editor-shell { display: grid; min-width: 1100px; height: calc(100vh - 80px); min-height: 620px; grid-template-rows: 70px auto auto minmax(0,1fr) 36px; overflow: hidden; border-bottom: 1px solid #1c2025; background: var(--shell); }
.file-bar { display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #b8bec6; background: #fff; }
.file-identity, .file-actions { display: flex; align-items: center; gap: 10px; }
.file-identity > div { min-width: 0; }
.file-kicker { display: block; margin: 0 0 1px 5px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.square-button, .toolbar-button, .save-button, .command-icon, .type-button { display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 3px; background: transparent; cursor: pointer; }
.square-button { width: 38px; height: 38px; border-color: #c8cdd3; }
.square-button:hover, .toolbar-button:hover, .command-icon:hover, .type-button:hover { border-color: var(--line); background: #f1f4f8; }
.document-name { display: block; width: 360px; height: 26px; padding: 1px 5px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.015em; }
.document-name:hover, .document-name:focus { border-color: #bcc7d4; background: #fff; outline: 0; }
.file-meta { display: flex; align-items: center; gap: 8px; padding-left: 5px; color: var(--muted); font-size: 10px; }
.file-meta span:first-child { padding: 2px 6px; border: 1px solid #b7c9ef; border-radius: 2px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 850; }
.file-actions { gap: 6px; }
.toolbar-button { min-width: 40px; height: 40px; padding: 0 11px; border-color: #c8cdd3; background: #fff; }
.toolbar-button.labeled { display: inline-flex; gap: 7px; font-size: 12px; font-weight: 750; }
.toolbar-button svg { width: 17px; }
.save-button { display: inline-flex; height: 40px; gap: 8px; padding: 0 17px; border-color: var(--blue-dark); background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 3px 3px 0 #172a50; }
.save-button:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.save-button svg { width: 17px; }

.ribbon { position: relative; z-index: 12; border-bottom: 1px solid #aeb4bc; background: #fff; box-shadow: 0 3px 0 rgba(22,24,29,.07); }
.ribbon-tabs { display: flex; height: 38px; align-items: flex-end; gap: 0; padding: 0 18px; border-bottom: 1px solid #d9dde2; }
.ribbon-tab { height: 38px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #505866; font-size: 12px; font-weight: 800; cursor: pointer; }
.ribbon-tab:hover { color: var(--blue-dark); }
.ribbon-tab.is-active { border-bottom-color: var(--blue); background: #f5f8ff; color: var(--blue-dark); }
.ribbon-panel { display: none; height: 94px; align-items: stretch; gap: 0; padding: 8px 18px 6px; overflow-x: auto; overflow-y: hidden; }
.ribbon-panel.is-active { display: flex; }
.command-group { position: relative; display: flex; min-width: max-content; align-items: center; gap: 5px; padding: 0 15px 18px; border-right: 1px solid #d8dce1; }
.command-group:first-child { padding-left: 0; }
.command-group > span:last-child { position: absolute; right: 8px; bottom: 0; left: 8px; color: #7d8895; font-size: 9px; font-weight: 650; text-align: center; }
.small-group { display: grid; grid-template-columns: 32px 32px; align-content: start; }
.small-group > span { grid-column: 1 / 3; }
.command-icon, .type-button { width: 34px; height: 34px; padding: 0; }
.command-icon svg { width: 21px; height: 21px; }
.type-button { font-family: Georgia, serif; font-size: 16px; }
.type-button.italic { font-style: italic; }
.type-button.underline { text-decoration: underline; }
.type-button.strike { text-decoration: line-through; }
.font-group { display: grid; min-width: 372px; grid-template-rows: 36px 36px; align-content: start; }
.inline-controls, .icon-row { display: flex; align-items: center; gap: 3px; }
.inline-controls select { height: 32px; padding: 3px 8px; border: 1px solid #b9c0c9; border-radius: 2px; background: #fff; color: var(--ink); font-size: 11px; }
#styleSelect { width: 102px; }
#fontSelect { width: 158px; }
#fontSizeSelect { width: 58px; }
.color-control { position: relative; display: grid; width: 35px; height: 34px; place-items: center; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.color-control:hover { border-color: var(--line); background: #f1f4f8; }
.color-control span { font-family: Georgia, serif; font-size: 16px; font-weight: 700; }
.color-control input { position: absolute; right: 2px; bottom: 2px; width: 25px; height: 4px; padding: 0; border: 0; opacity: .75; }
.paragraph-group { display: grid; min-width: 224px; grid-template-rows: 36px 36px; align-content: start; }
.compact-select { width: 58px; height: 31px; margin-left: 3px; border: 1px solid #b9c0c9; border-radius: 2px; font-size: 11px; }
.large-command { display: inline-flex; height: 66px; min-width: 68px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 5px 10px; border: 1px solid transparent; border-radius: 3px; background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.large-command:hover, .large-command.is-selected { border-color: #cdd9e9; background: var(--blue-soft); color: var(--blue-dark); }
.large-command svg { width: 26px; height: 26px; }
.search-group { min-width: 100px; }
.insert-group { gap: 4px; }
.layout-group { align-items: flex-start; gap: 10px; }
.layout-group label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.layout-group label > span { display: block; margin-bottom: 4px; }
.layout-group select { min-width: 122px; height: 36px; padding: 4px 8px; border: 1px solid #b9c0c9; border-radius: 2px; background: #fff; font-size: 11px; }

.compatibility-bar { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 7px 18px; border-bottom: 1px solid #d9c892; background: #fff9e9; color: #5b4b22; font-size: 10px; }
.compatibility-bar > div { display: flex; flex: 1; gap: 8px; }
.compatibility-bar button { padding: 4px 8px; border: 1px solid #cdbb83; border-radius: 5px; background: #fff; font-size: 9px; font-weight: 750; cursor: pointer; }

.work-area { display: grid; min-height: 0; grid-template-columns: 250px minmax(0, 1fr); background: var(--workspace); }
.outline-panel, .side-panel { min-width: 0; overflow: auto; border-right: 1px solid #b7bdc5; background: #fff; }
.side-panel { width: 330px; border-right: 0; border-left: 1px solid var(--line); }
.work-area.has-side { grid-template-columns: 250px minmax(0, 1fr) 330px; }
.work-area.no-outline { grid-template-columns: minmax(0, 1fr); }
.work-area.no-outline.has-side { grid-template-columns: minmax(0, 1fr) 330px; }
.panel-title { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; border-bottom: 1px solid #cdd1d7; box-shadow: inset 3px 0 0 var(--blue); }
.panel-title span { display: block; color: var(--blue-dark); font-size: 9px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.panel-title h2 { margin: 3px 0 0; font-size: 14px; letter-spacing: -.015em; }
.panel-title button { min-height: 28px; padding: 4px 7px; border: 1px solid #c8cdd3; border-radius: 2px; background: #fff; color: var(--muted); font-size: 9px; font-weight: 750; cursor: pointer; }
.outline-list { padding: 10px 11px; }
.outline-list p { margin: 12px 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.outline-link { display: block; width: 100%; overflow: hidden; padding: 8px 9px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: #4f5d6d; font-size: 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.outline-link:hover { background: var(--blue-soft); color: var(--blue-dark); }
.outline-link.level-2 { padding-left: 20px; }
.outline-link.level-3 { padding-left: 32px; color: var(--muted); }

.canvas-area { min-width: 0; overflow: auto; padding: 36px 58px 84px; background-color: var(--workspace); background-image: radial-gradient(#b7bdc5 .75px, transparent .75px); background-size: 14px 14px; }
.paper { position: relative; width: var(--paper-width); min-height: var(--paper-min-height); margin: 0 auto; padding: var(--paper-pad-y) var(--paper-pad-x); border: 1px solid rgba(22,24,29,.18); background: var(--paper); box-shadow: 0 12px 35px rgba(16,24,40,.22); transform: scale(var(--paper-scale, .9)); transform-origin: top center; transition: box-shadow .16s ease; }
.paper.a4 { --paper-width: 794px; --paper-min-height: 1123px; }
.paper.landscape { --paper-width: 1056px; --paper-min-height: 816px; }
.paper.a4.landscape { --paper-width: 1123px; --paper-min-height: 794px; }
.paper.margins-narrow { --paper-pad-x: 48px; --paper-pad-y: 48px; }
.paper.margins-moderate { --paper-pad-x: 72px; --paper-pad-y: 72px; }
.paper.draft-view { width: min(100%, 920px); min-height: 760px; padding: 70px 90px; box-shadow: none; }
.document-content, .header-zone, .footer-zone { outline: none; color: #202124; font-family: Arial, sans-serif; font-size: 11pt; line-height: 1.15; }
.document-content { min-height: calc(var(--paper-min-height) - (var(--paper-pad-y) * 2)); }
.document-content > :first-child { margin-top: 0; }
.document-content p { margin: 0 0 6pt; min-height: 1.15em; }
.document-content h1 { margin: 18pt 0 8pt; font-size: 24pt; line-height: 1.15; }
.document-content h2 { margin: 14pt 0 7pt; font-size: 18pt; line-height: 1.2; }
.document-content h3 { margin: 12pt 0 6pt; font-size: 14pt; line-height: 1.25; }
.document-content blockquote { margin: 10pt 24pt; padding-left: 12pt; border-left: 3px solid #bbc6d5; color: #4f5d6d; }
.document-content ul, .document-content ol { margin: 4pt 0 8pt; padding-left: 30pt; }
.document-content li { margin: 2pt 0; }
.document-content a { color: #205fc7; text-decoration: underline; text-underline-offset: 2px; }
.document-content img { max-width: 100%; height: auto; border-radius: 2px; }
.document-content figure { margin: 12pt 0; }
.document-content figure.align-center { text-align: center; }
.document-content figure.align-right { text-align: right; }
.document-content figcaption { margin-top: 4pt; color: var(--muted); font-size: 9pt; }
.document-content table { --table-border-width: 1px; --table-border-color: #8d96a2; --table-header-fill: #eef2f7; --table-cell-padding: 7px; width: 100%; margin: 10pt 0; border: var(--table-border-width) solid var(--table-border-color); border-collapse: collapse; table-layout: fixed; }
.document-content th, .document-content td { min-width: 30px; padding: var(--table-cell-padding); border: var(--table-border-width) solid var(--table-border-color); vertical-align: top; }
.document-content th { background: var(--table-header-fill); font-weight: 700; }
.document-content table.is-selected-table { outline: 3px solid rgba(58, 122, 254, .28); outline-offset: 3px; }
.document-content hr.page-break { height: 20px; margin: 22pt calc(var(--paper-pad-x) * -1); border: 0; border-top: 1px dashed #9ea8b5; border-bottom: 1px dashed #d8dee6; background: var(--workspace); break-after: page; }
.document-content hr.page-break::after { content: "Page break"; display: block; width: max-content; margin: -9px auto 0; padding: 0 8px; background: var(--workspace); color: #788492; font: 8px/16px Inter, sans-serif; }
.document-content .search-hit { background: #ffe8a8; }
.document-content .search-hit.current { outline: 2px solid #d69013; }
.header-zone, .footer-zone { position: absolute; right: var(--paper-pad-x); left: var(--paper-pad-x); min-height: 32px; padding: 4px 0; border-top: 1px dashed #8db0f4; border-bottom: 1px dashed #8db0f4; color: #505a66; font-size: 9pt; }
.header-zone { top: 38px; }
.footer-zone { bottom: 38px; }
.header-zone:empty::before, .footer-zone:empty::before { content: attr(data-placeholder); color: #9aa4b1; }

.side-panel > section { padding: 16px; }
.field-label { position: relative; display: block; margin-bottom: 14px; color: #4d5966; font-size: 10px; font-weight: 750; }
.field-label input, .field-label select { display: block; width: 100%; min-height: 36px; margin-top: 5px; padding: 7px 9px; border: 1px solid #bcc7d4; border-radius: 7px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 400; }
.field-label > span { position: absolute; right: 9px; bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 400; }
.find-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -5px 0 14px; color: var(--muted); font-size: 9px; }
.find-status button, .replace-actions button { min-height: 28px; padding: 4px 8px; border: 1px solid #c4ceda; border-radius: 6px; background: #fff; font-size: 9px; font-weight: 750; cursor: pointer; }
.replace-actions { display: flex; gap: 7px; margin-bottom: 14px; }
.replace-actions button:first-child { border-color: var(--blue); background: var(--blue); color: #fff; }
.check-row { display: flex; align-items: center; gap: 8px; color: #4f5d6d; font-size: 10px; }
.check-row input { accent-color: var(--blue); }
.stats-list { margin: 0; }
.stats-list div { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stats-list dt { color: var(--muted); font-size: 10px; }
.stats-list dd { margin: 0; font-size: 14px; font-weight: 800; }
.panel-copy { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.compatibility-list { margin: 0; padding-left: 18px; color: #485563; font-size: 10px; line-height: 1.6; }
.compatibility-list li { margin-bottom: 8px; }

.status-bar { display: flex; height: 36px; align-items: center; justify-content: space-between; padding: 0 16px; border-top: 1px solid #aeb4bc; background: #fff; color: #555d68; font-size: 10px; }
.status-bar > div { display: flex; align-items: center; gap: 14px; }
.status-bar button { border: 0; background: transparent; color: inherit; font-size: inherit; cursor: pointer; }
.zoom-control { display: flex; align-items: center; gap: 6px !important; }
.zoom-control input { width: 120px; accent-color: var(--blue); }
.zoom-control output { width: 33px; color: #3f4b58; font-weight: 750; }

.about-section { width: min(1100px, calc(100% - 64px)); margin: 90px auto; }
.about-section > div:first-child { display: grid; grid-template-columns: 340px 1fr; gap: 80px; align-items: start; }
.about-section h2 { margin: 7px 0 0; font-size: 32px; line-height: 1.12; letter-spacing: -.04em; }
.about-section > div:first-child p { margin: 0; color: var(--muted); font-size: 14px; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.about-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.about-grid h3 { margin: 0 0 7px; font-size: 15px; }
.about-grid p { margin: 0; color: var(--muted); font-size: 11px; }

.menu-popover { position: fixed; z-index: 1000; width: 320px; padding: 8px; border: 1px solid #9fa6af; border-radius: 2px; background: rgba(255,255,255,.99); box-shadow: 7px 7px 0 rgba(22,24,29,.88); }
.menu-popover button { display: block; width: 100%; min-height: 58px; padding: 11px 13px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.menu-popover button:hover { background: var(--blue-soft); }
.menu-popover strong, .menu-popover span { display: block; }
.menu-popover strong { font-size: 13px; }
.menu-popover span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.app-dialog { width: min(620px, calc(100% - 40px)); padding: 0; border: 1px solid #8f969f; border-radius: 2px; color: var(--ink); box-shadow: 9px 9px 0 rgba(22,24,29,.9); }
.app-dialog::backdrop, .pdf-dialog::backdrop { background: rgba(31, 41, 55, .46); backdrop-filter: blur(3px); }
.app-dialog form > header, .app-dialog form > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.app-dialog form > header { border-bottom: 1px solid var(--line); }
.app-dialog form > footer { border-top: 1px solid var(--line); }
.app-dialog header span { color: var(--blue-dark); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.app-dialog header h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.03em; }
.dialog-close { padding: 6px 8px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.dialog-body { padding: 20px; }
.image-picker { display: block; padding: 15px; border: 1px dashed #aeb9c7; border-radius: 9px; background: #f8faff; cursor: pointer; }
.image-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.image-picker span, .image-picker small { display: block; }
.image-picker span { color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.image-picker small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.image-preview { display: grid; min-height: 160px; margin: 12px 0; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #f1f4f8; color: var(--muted); font-size: 10px; }
.image-preview img { display: block; max-width: 100%; max-height: 220px; }
.two-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.small-dialog { width: 430px; }
.table-dialog-body { padding-top: 17px; }
.table-style-divider { display: flex; align-items: center; gap: 10px; margin: 17px 0 13px; color: #5c6875; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.table-style-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.color-field .color-input-shell { position: static; display: flex; min-height: 36px; align-items: center; gap: 9px; margin-top: 5px; padding: 5px 8px; border: 1px solid #bcc7d4; border-radius: 7px; background: #fff; }
.color-field input[type="color"] { display: block; width: 40px; min-height: 25px; margin: 0; padding: 0; border: 0; border-radius: 4px; cursor: pointer; }
.color-field output { color: #4d5966; font-size: 11px; font-weight: 650; }
.table-style-preview { display: grid; grid-template-columns: 1fr 1fr; margin-top: 2px; overflow: hidden; border: var(--preview-border-width, 1px) solid var(--preview-border-color, #8d96a2); border-radius: 6px; }
.table-style-preview span { padding: var(--preview-padding, 7px); border-right: var(--preview-border-width, 1px) solid var(--preview-border-color, #8d96a2); border-bottom: var(--preview-border-width, 1px) solid var(--preview-border-color, #8d96a2); background: #fff; color: #53606d; font-size: 9px; }
.table-style-preview span:nth-child(-n+2) { background: var(--preview-header-fill, #eef2f7); font-weight: 800; }
.table-style-preview span:nth-child(2n) { border-right: 0; }
.table-style-preview span:nth-last-child(-n+2) { border-bottom: 0; }
.table-edit-hint { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.save-options { display: grid; gap: 9px; }
.save-options > button, .save-options > .prepared-download { display: flex; width: 100%; min-height: 70px; align-items: center; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.save-options > button:hover, .save-options > .prepared-download:hover { border-color: #9dbaf5; background: var(--blue-soft); }
.save-options > .prepared-download { border-color: var(--blue); background: var(--blue-soft); }
.save-options svg { width: 24px; height: 24px; color: var(--blue-dark); }
.save-options strong, .save-options small { display: block; }
.save-options strong { font-size: 14px; }
.save-options small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.privacy-footer p { max-width: 380px; margin: 0; color: var(--muted); font-size: 9px; }

.pdf-dialog { width: calc(100vw - 70px); height: calc(100vh - 70px); padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
.pdf-shell { display: grid; height: 100%; grid-template-rows: 64px minmax(0, 1fr); background: #e7ebf0; }
.pdf-shell > header { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid #c8d1dc; background: #fff; }
.pdf-shell header span, .pdf-shell header strong { display: block; }
.pdf-shell header span { color: var(--blue-dark); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.pdf-shell header strong { overflow: hidden; margin-top: 3px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-shell header p { margin: 0; color: var(--muted); font-size: 9px; }
.pdf-shell header div:last-child { display: flex; gap: 6px; }
.pdf-shell header button { min-height: 32px; padding: 6px 10px; border: 1px solid #c8d1dc; border-radius: 6px; background: #fff; font-size: 10px; font-weight: 750; cursor: pointer; }
.pdf-shell iframe { width: 100%; height: 100%; border: 0; background: #d9dee5; }

:focus-visible { outline: 3px solid rgba(58, 122, 254, .3); outline-offset: 2px; }
button:active { transform: scale(.98); }

@media (max-width: 1279px) {
  .outline-panel { display: none; }
  .work-area { grid-template-columns: minmax(0, 1fr); }
  .work-area.has-side { grid-template-columns: minmax(0, 1fr) 330px; }
  .outlineToggleButton { opacity: .6; }
  .canvas-area { padding-right: 28px; padding-left: 28px; }
  .toolbar-button.labeled span { display: none; }
  .font-group { min-width: 310px; }
}

@media (max-width: 1023px), (pointer: coarse) and (max-width: 1180px) {
  .site-header, .desktop-app, .desktop-footer { display: none !important; }
  .desktop-gate { display: flex; min-height: 100vh; align-items: center; justify-content: center; flex-direction: column; padding: 40px; background: #fffaf0; text-align: center; }
  .gate-mark { display: grid; width: 58px; height: 54px; place-items: center; border: 2px solid #191c18; border-radius: 52% 48% 43% 57%; background: #ffd84d; box-shadow: 4px 4px 0 #191c18; font-size: 25px; font-weight: 950; transform: rotate(-6deg); }
  .desktop-gate h1 { margin: 26px 0 8px; font-size: 32px; letter-spacing: -.04em; }
  .desktop-gate p { max-width: 520px; margin: 0; color: var(--muted); }
  .desktop-gate a { margin-top: 24px; padding: 10px 16px; border: 2px solid #191c18; border-radius: 999px; background: #fff; color: #191c18; font-weight: 800; text-decoration: none; }
}

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

@page { size: Letter portrait; margin: 1in; }
@media print {
  body { background: #fff !important; }
  .site-header, .start-screen, .file-bar, .ribbon, .compatibility-bar, .outline-panel, .side-panel, .status-bar, .about-section, .site-footer, .desktop-gate, dialog, .menu-popover { display: none !important; }
  .desktop-app, .editor-shell, .work-area, .canvas-area { display: block !important; width: auto !important; min-width: 0 !important; height: auto !important; min-height: 0 !important; overflow: visible !important; padding: 0 !important; background: #fff !important; }
  .paper, .paper.a4, .paper.landscape, .paper.a4.landscape, .paper.draft-view { width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; transform: none !important; }
  .document-content { min-height: 0 !important; }
  .document-content hr.page-break { height: 0 !important; margin: 0 !important; border: 0 !important; break-after: page; }
  .document-content hr.page-break::after { display: none !important; }
  .document-content table { break-inside: auto; }
  .document-content tr, .document-content figure, .document-content h1, .document-content h2, .document-content h3 { break-inside: avoid; }
  .header-zone, .footer-zone { position: static !important; min-height: 0 !important; margin: 0 0 18pt !important; padding: 0 0 6pt !important; border: 0 !important; border-bottom: 1px solid #d4d8dd !important; }
  .footer-zone { margin: 18pt 0 0 !important; padding: 6pt 0 0 !important; border-top: 1px solid #d4d8dd !important; border-bottom: 0 !important; }
}
