@font-face {
  font-family: "ABAT";
  src: url("../fonts/ABAT.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7fb;
  color: #1f2937;
}

html.app-desktop-root,
html.app-desktop-root body.app-desktop {
  height: 100%;
  overflow: hidden;
}

body.app-desktop {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.app-desktop .app-header {
  flex-shrink: 0;
}

body.app-desktop .workspace {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

body.app-desktop .page {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px;
}

body.app-desktop .formatbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  flex-shrink: 0;
}

body.app-desktop .doc-surface {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin-bottom: 0;
}

body.app-desktop .status {
  overflow-y: auto;
  max-height: 100%;
  align-self: stretch;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 12px;
  min-height: 34px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 1;
  font-size: 12px;
  color: #4b5563;
  white-space: nowrap;
}

.header-doc {
  max-width: min(48vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111827;
  font-weight: 500;
}

.header-meta {
  flex-shrink: 0;
}

.header-sep {
  color: #d1d5db;
  user-select: none;
}

.app-brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 10px 5px;
  border-top: 3px solid #3cb54a;
  border-bottom: 3px solid #3cb54a;
  background: #fff;
  line-height: 1;
  flex-shrink: 0;
}

.app-brand-dosh {
  font-family: "ABAT", "ABAT Ed2026", "ABAT Ed", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.02em;
}

.app-brand-word {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.04em;
  margin-top: 0;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-root {
  position: relative;
}

.menu-trigger {
  border: 0;
  background: transparent;
  color: #111827;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
}

.menu-trigger:hover,
.menu-trigger.active {
  background: #f3f4f6;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  min-width: 220px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.menu-dropdown button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.menu-dropdown button:hover {
  background: #f3f4f6;
}

.menu-dropdown button.checked::before {
  content: "✓ ";
  color: #047857;
}

.menu-label {
  margin: 4px 10px 2px;
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-sep {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 4px 0;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  padding: 16px;
}

.page {
  min-height: calc(100vh - 100px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 24px;
}

.hint {
  margin-top: 0;
  color: #6b7280;
}

.formatbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.format-group {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
}

.format-group button,
.format-group select {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

.format-group button.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.lang-switch .lang-btn,
.lang-inline .lang-btn {
  min-width: 44px;
  font-weight: 600;
}

.format-group-primary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.lang-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
}

.format-group-primary #btn-toggle-vk {
  min-width: 36px;
  font-weight: 700;
}

.format-group-primary #btn-toggle-vk.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.format-group-primary #btn-clear-doc {
  font-size: 12px;
  padding: 6px 8px;
}

.lang-inline .lang-btn {
  min-width: 34px;
  padding: 6px 7px;
  font-size: 12px;
}

.format-group-tools select {
  max-width: 76px;
}

.doc-zoom-label {
  font-size: 11px;
  min-width: 36px;
  text-align: center;
}

.vk-scale-label {
  font-size: 11px;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
  color: #475569;
}

#btn-install-abat {
  font-weight: 600;
  min-width: 72px;
}

.format-group-history button {
  min-width: 36px;
  font-size: 16px;
  font-weight: 600;
}

.format-group-history button:disabled,
.format-group-clipboard button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.format-group-clipboard button {
  min-width: 36px;
}

.editor::selection {
  background: #2563eb;
  color: #fff;
}

.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 180px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.context-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.context-menu button:hover:not(:disabled) {
  background: #f3f4f6;
}

.context-menu button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.doc-surface {
  margin: 0 auto 12px;
  min-height: 620px;
  max-height: calc(100vh - 220px);
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #c5ccd6;
  padding: 24px 16px;
  overflow: auto;
}

.pages-root {
  width: 210mm;
  margin: 0 auto;
}

.page-sheet {
  width: 100%;
  height: 297mm;
  max-height: 297mm;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.page-sheet:last-child {
  margin-bottom: 0;
}

.page-body {
  height: calc(297mm - 37mm);
  max-height: calc(297mm - 37mm);
  margin: 25mm 20mm 12mm;
  overflow: hidden;
  outline: none;
  line-height: 1.15;
  font-size: 12pt;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.pages-root.docx-import .page-body {
  line-height: 1.15;
  font-size: 12pt;
}

.pages-root.docx-import .page-body p,
.pages-root.docx-import .editor-free p {
  margin: 0 0 0.15em;
  line-height: 1.15;
}

.pages-root.docx-import .page-body p.docx-bold-block,
.pages-root.docx-import .page-body p:has(strong:only-child),
.pages-root.docx-import .page-body strong {
  font-weight: 700;
}

.pages-root.docx-import .page-body p.docx-bold-block {
  margin-top: 10pt;
  margin-bottom: 10pt;
}

.page-body strong,
.page-body b,
.editor-free strong,
.editor-free b {
  font-weight: 700;
}

.pages-root.docx-mostly-center .page-body,
.pages-root.docx-mostly-center .editor-free {
  /* Выравнивание задаётся на каждом абзаце отдельно, не наследуем center на весь лист */
}

.page-sheet-label {
  position: absolute;
  right: 10mm;
  bottom: 6mm;
  font-size: 11px;
  color: #6b7280;
  font-family: "Segoe UI", Tahoma, sans-serif;
  pointer-events: none;
  z-index: 2;
}

.doc-surface.a4-mode .pages-root {
  width: 210mm;
}

.doc-surface.free-mode .pages-root {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto;
}

.doc-surface.free-mode {
  background: #c5ccd6;
  padding: 24px 16px;
}

.doc-surface.free-mode .editor-free {
  width: 100%;
  min-height: 297mm;
  margin: 0;
  border: none;
  border-radius: 2px;
  padding: 25mm 20mm 12mm;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

.editor,
.page-body,
.editor-free {
  min-height: 420px;
  outline: none;
  line-height: 1.15;
  font-size: 12pt;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.doc-surface.a4-mode .page-body {
  min-height: unset;
}

.doc-surface.free-mode .editor-free {
  min-height: 520px;
}

.editor p,
.page-body p,
.editor-free p {
  margin: 0 0 0.65em;
}

.editor p:last-child,
.page-body p:last-child,
.editor-free p:last-child {
  margin-bottom: 0;
}

.editor p[style*="text-align: center"],
.editor p[align="center"],
.page-body p[style*="text-align: center"],
.page-body p[align="center"],
.editor-free p[style*="text-align: center"],
.editor-free p[align="center"],
.page-body h1[style*="text-align: center"],
.page-body h2[style*="text-align: center"],
.page-body h3[style*="text-align: center"],
.page-body .text-left,
.page-body p.text-left,
.page-body h1.text-left,
.page-body h2.text-left,
.page-body h3.text-left,
.page-body div.text-left,
.editor-free .text-left {
  text-align: left !important;
}

.page-body .text-right,
.page-body p.text-right,
.page-body h1.text-right,
.page-body h2.text-right,
.page-body h3.text-right,
.page-body div.text-right,
.editor-free .text-right {
  text-align: right !important;
}

.page-body .text-center,
.page-body p.text-center,
.page-body h1.text-center,
.page-body h2.text-center,
.page-body h3.text-center,
.page-body div.text-center,
.editor-free .text-center {
  text-align: center !important;
}

.page-body .text-justify,
.page-body p.text-justify,
.page-body h1.text-justify,
.page-body h2.text-justify,
.page-body h3.text-justify,
.page-body div.text-justify,
.editor-free .text-justify {
  text-align: justify !important;
}

.format-group .align-group {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  background: #fff;
}

.format-group .align-btn {
  min-width: 28px;
  padding: 4px 5px;
  line-height: 0;
}

.format-group .align-btn svg {
  display: block;
}

.editor.lang-abat,
.page-body.lang-abat,
.editor-free.lang-abat {
  font-family: "ABAT", "ABAT Ed2026", "ABAT Ed", "ABAT Word", sans-serif;
  direction: ltr;
  unicode-bidi: normal;
}

.editor.lang-arabic,
.page-body.lang-arabic,
.editor-free.lang-arabic {
  font-family: "Amiri", "Noto Naskh Arabic", "Segoe UI", sans-serif;
}

.page-body hr.page-break,
.page-body hr.docx-page-break,
.editor-free hr.page-break,
.editor-free hr.docx-page-break {
  border: 0;
  height: 0;
  margin: 0;
  visibility: hidden;
}

.page-body img.doc-img,
.editor-free img.doc-img,
.page-body img,
.editor-free img {
  max-width: 100%;
  height: auto;
  display: block;
}

.doc-figure {
  position: relative;
  display: block;
  max-width: 100%;
  margin: 8px 0;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
}

.doc-figure.img-align-center {
  margin-left: auto;
  margin-right: auto;
}

.doc-figure.img-align-left {
  margin-left: 0;
  margin-right: auto;
}

.doc-figure.img-align-right {
  margin-left: auto;
  margin-right: 0;
}

.doc-figure.img-selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.doc-figure .doc-img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  pointer-events: none;
}

.doc-figure .img-handle {
  display: none;
  position: absolute;
  width: 12px;
  height: 12px;
  background: #2563eb;
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
  touch-action: none;
}

.doc-figure.img-selected .img-handle {
  display: block;
}

.doc-figure .img-handle-se {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.doc-figure .img-handle-e {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.doc-figure .img-handle-s {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.doc-figure.has-custom-height .doc-img {
  object-fit: fill;
}

.img-tools-panel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
}

.img-tools-panel.hidden {
  display: none;
}

.img-tools-label {
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  margin-right: 2px;
}

.img-size-label {
  font-size: 11px;
  min-width: 34px;
  text-align: center;
  font-weight: 600;
  color: #1e40af;
}

.context-menu .ctx-img-actions.hidden {
  display: none;
}

.context-menu .menu-sep {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 4px 0;
}

.editor.lang-english,
.page-body.lang-english,
.editor-free.lang-english {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.editor.lang-russian,
.page-body.lang-russian,
.editor-free.lang-russian {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.status {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  height: fit-content;
}

.save-notice {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
}

.save-notice.save-notice-warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fcd34d;
}

.hidden {
  display: none;
}

.kb-map {
  margin-top: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #f9fafb;
}

.kb-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.kb-subtitle {
  margin: 10px 0 6px;
  font-weight: 600;
  color: #374151;
}

.kb-main-rows,
.kb-extra-rows {
  display: grid;
  gap: 6px;
}

.kb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kb-key {
  min-width: 54px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  text-align: center;
}

.kb-key .kb-key-top {
  display: block;
  font-size: 12px;
  color: #6b7280;
}

.kb-key .kb-key-main {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.kb-key.kb-double {
  border-color: #f59e0b;
  background: #fffbeb;
}

.format-group button.active,
#btn-toggle-vk.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.format-group-primary #btn-clear-doc {
  color: #b45309;
  border-color: #fbbf24;
}

.format-group-primary #btn-clear-doc:hover {
  background: #fffbeb;
}

.format-group-vk #btn-clear-doc {
  color: #b45309;
  border-color: #fbbf24;
}

.format-group-vk #btn-clear-doc:hover {
  background: #fffbeb;
}

.vk-panel {
  --vk-scale: 1.15;
  margin-top: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  user-select: none;
  -webkit-user-select: none;
}

.vk-panel * {
  user-select: none;
  -webkit-user-select: none;
}

.vk-panel.vk-floating:not(.hidden) {
  position: fixed;
  z-index: 10000;
  width: 440px;
  height: 400px;
  min-width: 260px;
  min-height: 180px;
  max-width: 96vw;
  max-height: 88vh;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.28);
  border: 1px solid #94a3b8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f1f5f9;
  touch-action: none;
}

.vk-panel.vk-floating .vk-head {
  cursor: grab;
  user-select: none;
  touch-action: none;
  padding: 6px 8px;
  background: linear-gradient(#e2e8f0, #cbd5e1);
  border-bottom: 1px solid #94a3b8;
  flex-shrink: 0;
  align-items: center;
}

.vk-panel.vk-floating #vk-title {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.vk-panel.vk-floating .vk-head:active {
  cursor: grabbing;
}

.vk-head-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.vk-head-btn {
  min-width: 28px;
  height: 28px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.vk-head-btn:hover {
  background: #f8fafc;
}

.vk-drag-hint {
  font-size: 14px;
  color: #64748b;
  padding: 0 2px;
}

.vk-close-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.vk-close-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
}

.vk-panel.vk-floating .vk-rows {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.vk-panel.vk-floating .vk-row {
  display: grid;
  grid-template-columns: repeat(var(--vk-cols, 10), minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}

.vk-panel.vk-floating .vk-key-btn {
  min-width: 0;
  max-width: none;
  width: 100%;
  min-height: 0;
  max-height: none;
  padding: 1px 2px;
  border-radius: 4px;
}

.vk-panel.vk-floating .vk-key-btn .vk-key-label {
  font-size: calc(9px * var(--vk-scale, 1));
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vk-panel.vk-floating .vk-key-btn .vk-key-glyph {
  margin-top: 0;
  line-height: 1.05;
  font-size: calc(22px * var(--vk-scale, 1));
}

.vk-panel.vk-floating .vk-controls {
  flex-shrink: 0;
  margin-top: 0;
  padding: 6px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  gap: 4px;
  flex-wrap: wrap;
  align-items: stretch;
}

.vk-panel.vk-floating .vk-util-action {
  min-height: 40px;
  min-width: 52px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}

.vk-panel.vk-floating .vk-util-space {
  min-height: 40px;
  flex: 1 1 72px;
  min-width: 64px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
}

.vk-panel.vk-floating .vk-util-char {
  min-width: 30px;
  min-height: 40px;
  padding: 6px 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.vk-panel.vk-floating .vk-util.wide {
  min-width: 0;
}

.vk-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 50%, #64748b 50%, #64748b 58%, transparent 58%, transparent 68%, #64748b 68%, #64748b 76%, transparent 76%);
  opacity: 0.75;
  border-radius: 0 0 8px 0;
}

.vk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.vk-hint {
  font-size: 12px;
  color: #6b7280;
}

.vk-rows {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.vk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vk-rows[data-dir="rtl"] .vk-row {
  justify-content: flex-end;
}

.vk-key-btn {
  min-width: 48px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  padding: 5px 6px;
  cursor: pointer;
  text-align: center;
}

.vk-key-btn .vk-key-label {
  display: block;
  font-size: calc(13px * var(--vk-scale, 1));
  font-weight: 600;
  color: #374151;
  line-height: 1.15;
}

.vk-key-btn.lang-abat .vk-key-label {
  font-size: calc(14px * var(--vk-scale, 1));
  color: #111827;
}

.vk-key-btn .vk-key-glyph {
  display: block;
  font-size: calc(26px * var(--vk-scale, 1));
  line-height: 1.15;
  margin-top: 2px;
}

.vk-key-btn.lang-abat .vk-key-glyph {
  font-family: "ABAT", "ABAT Ed2026", "ABAT Ed", "ABAT Word", sans-serif;
}

.vk-key-btn.lang-arabic .vk-key-glyph {
  font-family: "Amiri", "Noto Naskh Arabic", "Segoe UI", sans-serif;
}

.vk-key-btn.lang-english .vk-key-glyph {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.vk-key-btn.lang-russian .vk-key-glyph {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.vk-controls {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}

.vk-util {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.vk-util-action {
  min-height: 42px;
  min-width: 56px;
  font-size: 14px;
  font-weight: 600;
}

.vk-util-space {
  min-height: 42px;
  flex: 1 1 100px;
  min-width: 80px;
  font-size: 14px;
  font-weight: 600;
}

.vk-util-char {
  min-width: 36px;
  min-height: 42px;
  padding: 8px 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.vk-util.wide {
  min-width: 180px;
}

.vk-util.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html.print-mode,
  html.print-mode body.app-desktop {
    height: auto;
    overflow: visible;
  }

  body.app-desktop {
    display: block;
    height: auto;
    overflow: visible;
  }

  .app-header,
  .formatbar,
  .status,
  .menubar,
  .vk-panel,
  .kb-map,
  .hint,
  .context-menu {
    display: none !important;
  }

  .workspace {
    display: block !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .page {
    border: none !important;
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .doc-surface {
    border: none !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    max-height: none !important;
    min-height: 0 !important;
  }

  .pages-root {
    width: 210mm;
    margin: 0 auto;
  }

  .page-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    height: 297mm;
    overflow: visible !important;
    page-break-after: always;
    break-after: page;
  }

  .page-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .page-body,
  .editor-free {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  .page-sheet-label {
    display: block !important;
  }
}
