/* ═══════════════════════════════════════════════════════════════════
   Kameyo A4 Specification Studio — 100% Microsoft Word 365 Architecture
   Desktop-Grade Engine: Unified Stage & Rulers Rig, Fluent Office 365
   Ribbon Suite, Strict Dark Theme Isolation, Interactive Zoom Slider,
   Format Painter, Table Engine, Shapes, Symbols & DTP Tools.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 0. CRM Global Reset & Complete Isolation ── */
:root, .kmy-word-app {
  --kmy-cursor-ibeam: text;
  --kmy-cursor-pointer: default;
}

.kmy-word-app, .kmy-word-app * {
  box-sizing: border-box !important;
}

.kmy-word-app {
  position: fixed;
  inset: 0;
  background: #edebe9;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  color: #201f1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Calibri, sans-serif;
  user-select: none;
  overflow: hidden;
}

/* Strict Native Select & Input Resets (Crushes Any Dark CRM CSS) */
.kmy-word-app select,
.kmy-word-app select.kmy-w-select-btn {
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  appearance: menulist !important;
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #201f1e !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 3px !important;
  height: 24px !important;
  line-height: 22px !important;
  padding: 0 4px !important;
  font-size: 12px !important;
  font-family: Calibri, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  cursor: pointer !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.kmy-word-app select:hover {
  border-color: #94a3b8 !important;
  background-color: #f8fafc !important;
}

.kmy-word-app select:focus {
  border-color: #185abd !important;
  box-shadow: 0 0 0 1px #185abd !important;
}

.kmy-word-app select option {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #201f1e !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

.kmy-word-app input[type="text"],
.kmy-word-app input.kmy-dialog-input {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #201f1e !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 3px !important;
  box-sizing: border-box !important;
}

/* ── 1. Top Title Bar (Signature Word 365 Light Fluent Header) ── */
.kmy-w-titlebar {
  background: #f3f2f1;
  border-bottom: 1px solid #e1dfdd;
  color: #201f1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 40px;
  flex-shrink: 0;
}

.kmy-w-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kmy-w-icon-badge {
  width: 24px;
  height: 24px;
  background: #185abd;
  color: #ffffff;
  font-weight: 900;
  font-size: 15px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.kmy-w-autosave-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #484644;
  font-weight: 500;
  background: #edebe9;
  border: 1px solid #e1dfdd;
  padding: 2px 8px;
  border-radius: 12px;
}

.kmy-w-autosave-pill {
  width: 24px;
  height: 13px;
  background: #107c41;
  border-radius: 10px;
  position: relative;
}

.kmy-w-autosave-pill::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 1.5px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
}

.kmy-w-quick-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #484644 !important;
  height: 26px !important;
  width: 26px !important;
  padding: 0 !important;
  border-radius: 3px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.kmy-w-quick-btn:hover {
  background: #e1dfdd !important;
  color: #201f1e !important;
}

.kmy-w-doc-title {
  font-weight: 600;
  font-size: 12.5px;
  color: #201f1e;
  margin-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.kmy-w-title-center {
  flex: 1;
  max-width: 440px;
  margin: 0 16px;
}

.kmy-w-search-bar {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 16px !important;
  padding: 3px 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04) !important;
  cursor: pointer !important;
}

.kmy-w-search-bar:hover {
  border-color: #185abd !important;
}

.kmy-w-search-bar input {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  color: #201f1e !important;
  font-size: 12px !important;
  width: 100% !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.kmy-w-search-bar input::placeholder {
  color: #605e5c !important;
}

.kmy-w-title-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kmy-w-head-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #323130 !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.12s ease !important;
}

.kmy-w-head-btn:hover {
  background: #f3f4f6 !important;
  border-color: #94a3b8 !important;
  color: #185abd !important;
}

.kmy-w-head-btn.primary {
  background: #185abd !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #185abd !important;
}

.kmy-w-head-btn.primary:hover {
  background: #114389 !important;
  border-color: #114389 !important;
}

.kmy-w-head-btn.danger {
  color: #dc2626 !important;
}

.kmy-w-head-btn.danger:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

/* ── 2. Ribbon Tabs Bar (Word 365 Tab Strip) ── */
.kmy-w-tabbar {
  background: #f3f2f1;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 34px;
  flex-shrink: 0;
}

.kmy-w-tab {
  background: transparent !important;
  border: none !important;
  color: #323130 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  cursor: pointer !important;
  border-bottom: 2.5px solid transparent !important;
  transition: all 0.12s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  user-select: none;
}

.kmy-w-tab:hover {
  color: #185abd !important;
  background: #edebe9 !important;
}

.kmy-w-tab.active {
  color: #185abd !important;
  font-weight: 700 !important;
  border-bottom-color: transparent !important;
  background: #ffffff !important;
}

/* Word 365 sliding underline — grows from the centre when a tab activates */
.kmy-w-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2.5px;
  height: 2.5px;
  background: #185abd;
  border-radius: 2px;
  transform-origin: center;
  animation: kmyTabUnderline 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes kmyTabUnderline {
  from { transform: scaleX(0); opacity: 0.4; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Authentic Modern Word 365 File Tab: Sleek, perfectly aligned, no cutoff */
.kmy-w-tab.file-tab {
  background: #185abd !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  padding: 4px 14px !important;
  margin: 0 6px 0 2px !important;
  border-bottom: none !important;
  line-height: 18px !important;
  height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.kmy-w-tab.file-tab:hover {
  background: #114389 !important;
  color: #ffffff !important;
}

/* ── 3. Ribbon Body (Fluent Tool Groups) ── */
.kmy-w-ribbon-body {
  background: #ffffff;
  border-bottom: 1px solid #d1d5db;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  padding: 4px 10px 3px 10px;
  min-height: 94px;
  max-height: 94px;
  display: flex;
  align-items: stretch;
  overflow: visible !important;
  flex-shrink: 0;
  position: relative;
  z-index: 10000 !important;
}

.kmy-w-ribbon-pane {
  display: none;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  overflow: visible !important;
}

.kmy-w-ribbon-pane.active {
  display: flex;
}

/* ── Word 365 ribbon switch animation: groups glide in on tab change ── */
.kmy-w-ribbon-pane.active .kmy-w-group {
  animation: kmyRibbonGroupIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(1)  { animation-delay: 0.00s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(2)  { animation-delay: 0.022s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(3)  { animation-delay: 0.044s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(4)  { animation-delay: 0.066s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(5)  { animation-delay: 0.088s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(6)  { animation-delay: 0.11s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(7)  { animation-delay: 0.132s; }
.kmy-w-ribbon-pane.active .kmy-w-group:nth-child(n+8) { animation-delay: 0.154s; }

@keyframes kmyRibbonGroupIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .kmy-w-ribbon-pane.active .kmy-w-group { animation: none; }
}

/* Tool Group Container */
.kmy-w-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 8px;
  border-right: 1px solid #e1dfdd;
  flex-shrink: 0;
  position: relative;
  overflow: visible !important;
}

.kmy-w-group:last-child {
  border-right: none;
}

.kmy-w-group-tools {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  justify-content: center;
  overflow: visible !important;
}

.kmy-w-row {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: visible !important;
}

.kmy-w-group-title {
  text-align: center;
  font-size: 10.5px;
  color: #605e5c;
  font-weight: 500;
  letter-spacing: 0.1px;
  margin-top: 2px;
  padding-bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.kmy-w-group-launcher {
  position: absolute;
  right: -4px;
  bottom: 0;
  width: 12px;
  height: 12px;
  opacity: 0.55;
  cursor: pointer;
  font-size: 11px;
}

.kmy-w-group-launcher:hover {
  opacity: 1;
  color: #185abd;
}

/* ── Ribbon Buttons & Icons ── */
.kmy-btn-tool {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #323130 !important;
  height: 24px !important;
  min-width: 24px !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  cursor: pointer !important;
  transition: all 0.1s ease !important;
  position: relative !important;
}

.kmy-btn-tool:hover {
  background: #f3f2f1 !important;
  border-color: #e1dfdd !important;
  color: #201f1e !important;
}

.kmy-btn-tool:active {
  transform: scale(0.96) !important;
  background: #dbeafe !important;
  border-color: #bfdbfe !important;
  color: #185abd !important;
}

.kmy-btn-tool.active {
  background: #dbeafe !important;
  border-color: #bfdbfe !important;
  color: #185abd !important;
}

/* Big 2-Row Buttons (like Blank Page, Paste, Tables, Pictures) */
.kmy-btn-tool.big-btn {
  height: 58px !important;
  min-width: 52px !important;
  max-width: 88px !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 3px 6px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-align: center !important;
  white-space: normal !important;
  line-height: 1.15 !important;
}

.kmy-btn-tool.big-btn .kmy-svg-icon {
  width: 22px;
  height: 22px;
}

.kmy-svg-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Select Dropdowns */
.kmy-w-select-btn {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #201f1e !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 3px !important;
  height: 24px !important;
  line-height: 22px !important;
  padding: 0 4px !important;
  font-size: 12px !important;
  font-family: Calibri, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  cursor: pointer !important;
  outline: none !important;
}

/* Ribbon Dropdowns Containers */
.kmy-w-dropdown {
  position: relative;
  display: inline-block;
}

/* Popover Menus (Office Style Dropdown Menus) */
.kmy-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 3px;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22) !important;
  z-index: 20000 !important;
  display: none;
  min-width: 180px;
  max-height: 480px;
  overflow-y: auto;
}

.kmy-popover.show {
  display: block;
  animation: kmyFluentFlyIn 0.12s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes kmyFluentFlyIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Word 365 Right-Click Context Menu ── */
.kmy-ctxmenu {
  position: fixed;
  z-index: 2147483000;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #d0cfce;
  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.14);
  padding: 4px 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Calibri, sans-serif;
  color: #201f1e;
  user-select: none;
  animation: kmyCtxIn 0.11s cubic-bezier(0, 0, 0.2, 1);
}
@keyframes kmyCtxIn {
  from { opacity: 0; transform: scale(0.97) translateY(-3px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mini format strip at the top (like Word's floating toolbar) */
.kmy-ctx-mini {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px 5px;
  margin-bottom: 3px;
  border-bottom: 1px solid #ecebe9;
}
.kmy-ctx-mini button {
  width: 28px;
  height: 26px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.06s ease;
}
.kmy-ctx-mini button:hover { background: #f3f2f1; border-color: #e1dfdd; }
.kmy-ctx-mini button:active { transform: scale(0.92); background: #dbeafe; border-color: #bfdbfe; }

.kmy-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
  white-space: nowrap;
}
.kmy-ctx-item:hover { background: #f0f6ff; }
.kmy-ctx-item .kmy-ctx-ic {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.9;
}
.kmy-ctx-item .kmy-ctx-lbl { flex: 1; }
.kmy-ctx-item .kmy-ctx-key {
  color: #8a8886;
  font-size: 11.5px;
  margin-left: 18px;
}
.kmy-ctx-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.kmy-ctx-item.danger:hover { background: #fdecea; }
.kmy-ctx-item.danger .kmy-ctx-lbl { color: #c0392b; }
.kmy-ctx-sep {
  height: 1px;
  background: #ecebe9;
  margin: 4px 0;
}

.kmy-active-popover-group {
  z-index: 10000 !important;
}

.kmy-active-popover-drop {
  z-index: 10001 !important;
}

.kmy-popover-item {
  padding: 6px 12px;
  font-size: 12px;
  color: #323130;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.1s ease;
}

.kmy-popover-item:hover {
  background: #eff6ff;
  color: #185abd;
}

.kmy-popover-item.active {
  font-weight: 700;
  color: #185abd;
  background: #f0f4f9;
}

.kmy-popover-divider {
  height: 1px;
  background: #e1dfdd;
  margin: 4px 0;
}

/* Color Toolbars */
.kmy-w-color-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
}

.kmy-w-color-btn:hover {
  background: #f3f2f1;
}

.kmy-w-color-btn input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.kmy-w-color-bar {
  width: 15px;
  height: 3px;
  margin-top: 1px;
  border-radius: 1px;
}

/* ── 4. Interactive 10x8 Table Grid Picker ── */
.kmy-table-picker-box {
  padding: 10px 12px;
  background: #ffffff;
}

.kmy-table-grid-status {
  font-size: 11.5px;
  font-weight: 700;
  color: #185abd;
  margin-bottom: 8px;
  text-align: center;
}

.kmy-table-grid-cells {
  display: grid;
  grid-template-columns: repeat(10, 18px);
  grid-template-rows: repeat(8, 18px);
  gap: 3px;
}

.kmy-grid-cell {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.05s ease;
}

.kmy-grid-cell.highlight {
  background: #93c5fd;
  border-color: #185abd;
}

/* ── 5. Authentic Word 365 Styles Gallery (Screenshot 2 Match) ── */
.kmy-styles-gallery-container {
  display: flex;
  align-items: center;
  height: 58px;
  position: relative;
  overflow: visible !important;
}

.kmy-styles-viewport {
  width: 284px;
  max-width: 284px;
  height: 58px;
  overflow: hidden !important; /* STRICTLY NO SCROLLBAR */
  position: relative;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.kmy-styles-viewport::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.kmy-styles-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible !important;
}

.kmy-style-card {
  height: 54px;
  min-width: 68px;
  max-width: 68px;
  width: 68px;
  border: 1px solid #e1dfdd;
  border-radius: 3px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 5px 3px 4px 3px;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.kmy-style-card:hover {
  border-color: #185abd;
  background: #f0f7ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24, 90, 189, 0.12);
}

.kmy-style-card.active {
  border-color: #185abd !important;
  background: #e0edfe !important;
  box-shadow: inset 0 0 0 1px #185abd;
}

.kmy-style-card-preview {
  display: block;
  text-align: center;
  width: 100%;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.kmy-style-card-label {
  font-size: 10px;
  color: #323130;
  font-weight: 500;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* 3-Button Vertical Navigation Column (Exact Word 365 Match) */
.kmy-styles-nav {
  display: flex;
  flex-direction: column;
  width: 17px;
  margin-left: 3px;
  border: 1px solid #e1dfdd;
  border-radius: 3px;
  background: #f9fafb;
  overflow: hidden;
  height: 54px;
  flex-shrink: 0;
}

.kmy-style-nav-btn {
  height: 18px;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #605e5c;
  font-size: 8px;
  padding: 0;
  transition: all 0.1s ease;
  user-select: none;
}

.kmy-style-nav-btn:hover {
  background: #e5e7eb;
  color: #185abd;
}

.kmy-style-nav-btn.mid {
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.kmy-style-nav-btn.more {
  font-size: 10px;
  font-weight: bold;
}

.kmy-styles-full-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* ── 6. WORD 365 VIEWPORT & DUAL RULERS ARCHITECTURE ── */
/* Top Horizontal Ruler Bar (Directly beneath Ribbon, fixed across window width) */
.kmy-w-top-ruler-bar {
  height: 22px;
  background: #edebe9;
  border-bottom: 1px solid #d1d5db;
  position: relative;
  width: 100%;
  flex-shrink: 0;
  z-index: 4000;
  user-select: none;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* Corner Tab Alignment Selector (Pinned to top-left corner, exactly above left vertical ruler) */
.kmy-ruler-corner {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  background: #edebe9;
  border-right: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.12s ease;
}

.kmy-ruler-corner:hover {
  background: #e2e8f0;
}

.kmy-ruler-corner:active {
  background: #cbd5e1;
}

.kmy-corner-tab-icon {
  font-family: Consolas, monospace, sans-serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  color: #185abd;
}

/* Horizontal Ruler Viewport: clips ruler track horizontally */
.kmy-top-ruler-viewport {
  flex: 1;
  height: 22px;
  overflow: hidden;
  position: relative;
}

.kmy-top-ruler-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 22px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  pointer-events: auto;
  will-change: transform;
}

/* Main Split Viewport: Left Pinned Vertical Ruler + Center Scrollable Workspace */
.kmy-w-main-viewport {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(100% - 22px);
  box-sizing: border-box;
}

/* Left Pinned Vertical Ruler Bar (Docked to screen's left edge, matching Word 365!) */
.kmy-w-left-ruler-bar {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 100%;
  background: #edebe9;
  border-right: 1px solid #d1d5db;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  z-index: 3500;
  user-select: none;
  box-sizing: border-box;
}

.kmy-vruler-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  will-change: transform;
}

/* Main Document Workspace (Scrollable container for pages) */
.kmy-w-workspace {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #edebe9;
  padding: 24px 30px 60px 30px;
  display: flex;
  flex-direction: column;
  align-items: safe center;
  position: relative;
  box-sizing: border-box;
}

/* The Stage contains the pages with razor-sharp native vector zoom rendering */
.kmy-w-stage {
  width: 210mm;
  min-width: 210mm;
  max-width: 210mm;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  transform-origin: top center;
  transition: none !important;
  -webkit-font-smoothing: subpixel-antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: geometricPrecision !important;
}

/* Landscape mode width */
.kmy-landscape .kmy-w-stage {
  width: 297mm !important;
  min-width: 297mm !important;
  max-width: 297mm !important;
}

/* Top Horizontal Calibrated Ruler */
.kmy-w-ruler {
  width: 210mm;
  min-width: 210mm;
  max-width: 210mm;
  height: 22px;
  background: #ffffff;
  border-right: 1px solid #d1d5db;
  position: relative;
  display: flex;
  align-items: flex-end;
  box-sizing: border-box;
  flex-shrink: 0;
  cursor:var(--kmy-visible-crosshair);
}

/* Ruler dimensions come from the rendered page, including zoom. */

.kmy-ruler-left-margin {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 15mm;
  background: #e1dfdd;
  border-right: 1px solid #94a3b8;
}

.kmy-ruler-right-margin {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 15mm;
  background: #e1dfdd;
  border-left: 1px solid #94a3b8;
}

.kmy-ruler-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: #9ca3af;
  height: 4px;
}

.kmy-ruler-tick.major {
  height: 8px;
  background: #475569;
}

.kmy-ruler-num {
  position: absolute;
  bottom: 7px;
  font-size: 8.5px;
  font-weight: 600;
  color: #475569;
  transform: translateX(-50%);
  user-select: none;
}

/* Indent Markers on Top Ruler (Authentic Microsoft Word 365 Triangles + Base Box) */
.kmy-indent-marker-first {
  position: absolute;
  top: 0;
  left: 15mm;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5.5px solid #484644;
  cursor:var(--kmy-visible-ew-resize);
  transform: translateX(-50%);
  z-index: 20;
}

.kmy-indent-marker-left {
  position: absolute;
  bottom: 4px;
  left: 15mm;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-bottom: 5.5px solid #484644;
  cursor:var(--kmy-visible-ew-resize);
  transform: translateX(-50%);
  z-index: 20;
}

.kmy-indent-marker-box {
  position: absolute;
  bottom: 0;
  left: 15mm;
  width: 9px;
  height: 4px;
  background: #ffffff;
  border: 1px solid #484644;
  border-radius: 0.5px;
  cursor:var(--kmy-visible-ew-resize);
  transform: translateX(-50%);
  z-index: 20;
}

.kmy-indent-marker-right {
  position: absolute;
  bottom: 0;
  right: 15mm;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-bottom: 6px solid #484644;
  cursor:var(--kmy-visible-ew-resize);
  transform: translateX(50%);
  z-index: 20;
}

/* Tab Stop Markers on Top Horizontal Ruler (Authentic Word 365) */
.kmy-tab-stop-marker {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 12px;
  cursor:var(--kmy-visible-ew-resize);
  transform: translateX(-50%);
  z-index: 30;
  user-select: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Left Tab icon: L */
.kmy-tab-stop-marker.left::after {
  content: "";
  width: 5px;
  height: 7px;
  border-left: 2px solid #185abd;
  border-bottom: 2px solid #185abd;
  display: block;
}

/* Center Tab icon: ⊥ */
.kmy-tab-stop-marker.center::after {
  content: "";
  width: 7px;
  height: 7px;
  border-bottom: 2px solid #185abd;
  position: relative;
  display: block;
}
.kmy-tab-stop-marker.center::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 7px;
  background: #185abd;
  transform: translateX(-50%);
}

/* Right Tab icon: ⅃ */
.kmy-tab-stop-marker.right::after {
  content: "";
  width: 5px;
  height: 7px;
  border-right: 2px solid #185abd;
  border-bottom: 2px solid #185abd;
  display: block;
}

/* Decimal Tab icon: ⊥. */
.kmy-tab-stop-marker.decimal::after {
  content: "";
  width: 7px;
  height: 7px;
  border-bottom: 2px solid #185abd;
  position: relative;
  display: block;
}
.kmy-tab-stop-marker.decimal::before {
  content: "";
  position: absolute;
  left: 35%;
  bottom: 0;
  width: 2px;
  height: 7px;
  background: #185abd;
  transform: translateX(-50%);
}

/* Vertical Tab Guideline during Dragging */
.kmy-tab-guideline {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dashed #185abd;
  pointer-events: none;
  z-index: 99999;
  display: none;
}

/* Inline Tab Space inside content */
.kmy-tab-space {
  display: inline-block;
  min-width: 12.7mm;
  white-space: pre;
  user-select: none;
}

/* Custom Bullet Library */
ul.kmy-bullet-round {
  list-style-type: disc !important;
}

ul.kmy-bullet-hollow {
  list-style-type: circle !important;
}

ul.kmy-bullet-square {
  list-style-type: square !important;
}

ul.kmy-bullet-diamond {
  list-style: none !important;
  padding-left: 24px !important;
}
ul.kmy-bullet-diamond > li {
  position: relative !important;
  list-style: none !important;
}
ul.kmy-bullet-diamond > li::before {
  content: "❖";
  position: absolute;
  left: -18px;
  color: #d97706;
  font-size: 13px;
}

ul.kmy-bullet-star {
  list-style: none !important;
  padding-left: 24px !important;
}
ul.kmy-bullet-star > li {
  position: relative !important;
  list-style: none !important;
}
ul.kmy-bullet-star > li::before {
  content: "✦";
  position: absolute;
  left: -18px;
  color: #2563eb;
  font-size: 13px;
}

ul.kmy-bullet-check {
  list-style: none !important;
  padding-left: 24px !important;
}

ul.kmy-bullet-check > li {
  position: relative !important;
  list-style: none !important;
}

ul.kmy-bullet-check > li::before {
  content: "✓";
  position: absolute;
  left: -18px;
  color: #16a34a;
  font-weight: bold;
}

ul.kmy-bullet-arrow {
  list-style: none !important;
  padding-left: 24px !important;
}

ul.kmy-bullet-arrow > li {
  position: relative !important;
  list-style: none !important;
}

ul.kmy-bullet-arrow > li::before {
  content: "➢";
  position: absolute;
  left: -18px;
  color: #1e293b;
  font-size: 13px;
}

ul.kmy-bullet-none {
  list-style: none !important;
  padding-left: 0 !important;
}
ul.kmy-bullet-none > li {
  list-style: none !important;
}

/* Vertical Left Ruler (Pinned to left viewport edge, matching Word 365) */
.kmy-w-vruler {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 297mm;
  background: #ffffff;
  position: relative;
  box-sizing: border-box;
  user-select: none;
  flex-shrink: 0;
}

/* Vertical ruler height is synchronized with the rendered page. */

.kmy-vruler-top-margin {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12.7mm;
  background: #e1dfdd;
  border-bottom: 1px solid #94a3b8;
}

.kmy-vruler-bottom-margin {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12.7mm;
  background: #e1dfdd;
  border-top: 1px solid #94a3b8;
}

.kmy-vruler-tick {
  position: absolute;
  right: 0;
  height: 1px;
  background: #9ca3af;
  width: 4px;
}

.kmy-vruler-tick.major {
  width: 8px;
  background: #475569;
}

.kmy-vruler-num {
  position: absolute;
  right: 9px;
  font-size: 8px;
  font-weight: 600;
  color: #475569;
  transform: translateY(-50%);
  user-select: none;
}

/* Document Pages Canvas */
.kmy-w-canvas {
  width: 210mm;
  min-width: 210mm;
  max-width: 210mm;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
}

.kmy-landscape .kmy-w-canvas {
  width: 297mm !important;
  min-width: 297mm !important;
  max-width: 297mm !important;
}

/* ── 7. A4 Paper Styling ── */
.kmy-w-a4-page {
  width: 210mm;
  min-height: 297mm;
  max-width: 210mm;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  padding: 12.7mm 15mm;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  font-size: 10pt;
  line-height: 1.35;
  cursor: var(--kmy-cursor-pointer) !important;
  caret-color: #000000 !important;
  user-select: text !important;
}

.kmy-w-workspace,
.kmy-w-stage {
  cursor: var(--kmy-cursor-pointer) !important;
}

/* Document Text and Content: Bold High-Contrast Black I-Beam with White Halo */
.kmy-w-header,
.kmy-w-content,
.kmy-w-footer {
  cursor: var(--kmy-cursor-ibeam) !important;
  caret-color: #000000 !important;
  user-select: text !important;
}

.kmy-w-content *,
.kmy-w-header *,
.kmy-w-footer *,
[contenteditable="true"],
[contenteditable="true"] * {
  cursor: var(--kmy-cursor-ibeam) !important;
  caret-color: #000000 !important;
}

/* Objects that have specialized interaction cursors */
.kmy-wimg-box, .kmy-floating-shape {
  cursor:var(--kmy-visible-move) !important;
}
.kmy-handle, .kmy-shape-handle {
  cursor: inherit !important;
}
.kmy-wtable td, .kmy-wtable th {
  cursor: var(--kmy-cursor-ibeam) !important;
  caret-color: #000000 !important;
}

.kmy-landscape .kmy-w-a4-page {
  width: 297mm !important;
  min-height: 210mm !important;
  max-width: 297mm !important;
}

.kmy-page-tag {
  position: absolute;
  top: -22px;
  left: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #484644;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-bottom: none;
  padding: 1px 10px;
  border-radius: 3px 3px 0 0;
}

.kmy-page-del {
  position: absolute;
  top: -22px;
  right: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #dc2626;
  background: #ffffff;
  border: 1px solid #fca5a5;
  border-bottom: none;
  padding: 1px 10px;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
}

.kmy-page-del:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Header, Content & Footer Zones — Word behaviour:
   dimmed & locked until double-clicked, no labels/guides in the resting state */
.kmy-w-header {
  border-bottom: 1px solid transparent;
  padding-bottom: 6px;
  margin-bottom: 10px;
  min-height: 38px;
  outline: none;
  position: relative;
  opacity: 0.55;
  cursor:var(--kmy-visible-default) !important;
  transition: opacity 0.15s ease;
}

.kmy-w-content {
  flex: 1;
  min-height: 210mm;
  outline: none;
  position: relative;
  transition: opacity 0.15s ease;
}

.kmy-w-footer {
  border-top: 1px solid transparent;
  padding-top: 6px;
  margin-top: 10px;
  min-height: 24px;
  font-size: 8.5pt;
  color: #64748b;
  outline: none;
  position: relative;
  opacity: 0.55;
  cursor:var(--kmy-visible-default) !important;
  transition: opacity 0.15s ease;
}

/* A header/footer that is currently being edited (post double-click) */
.kmy-w-header.kmy-hf-editing,
.kmy-w-footer.kmy-hf-editing {
  opacity: 1;
  cursor: var(--kmy-cursor-ibeam) !important;
}
.kmy-w-header.kmy-hf-editing { border-bottom: 1px dashed #b9c2cf; }
.kmy-w-footer.kmy-hf-editing { border-top: 1px dashed #b9c2cf; }

.kmy-w-header.kmy-hf-editing::before,
.kmy-w-footer.kmy-hf-editing::before {
  position: absolute;
  right: 0;
  font-size: 8.5px;
  color: #185abd;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.kmy-w-header.kmy-hf-editing::before { content: "Header"; top: -14px; }
.kmy-w-footer.kmy-hf-editing::before { content: "Footer"; bottom: -14px; }

/* When editing a header/footer, the body dims (and vice-versa) — like Word */
.kmy-hf-mode .kmy-w-content { opacity: 0.4; }
.kmy-hf-mode .kmy-w-header:not(.kmy-hf-editing),
.kmy-hf-mode .kmy-w-footer:not(.kmy-hf-editing) { opacity: 0.4; }

/* Guidelines Toggle Off */
.kmy-guidelines-off .kmy-w-header,
.kmy-guidelines-off .kmy-w-footer {
  border-color: transparent !important;
}

.kmy-guidelines-off .kmy-w-header::before,
.kmy-guidelines-off .kmy-w-footer::before {
  display: none !important;
}

/* Margins & Multi-Column */
.kmy-margins-normal .kmy-w-a4-page { padding: 15mm 15mm !important; }
.kmy-margins-narrow .kmy-w-a4-page { padding: 10mm 10mm !important; }
.kmy-margins-moderate .kmy-w-a4-page { padding: 20mm 15mm !important; }
.kmy-margins-wide .kmy-w-a4-page { padding: 25mm 25mm !important; }

.kmy-2-columns {
  column-count: 2 !important;
  column-gap: 8mm !important;
  column-rule: 1px solid #e2e8f0 !important;
}

/* ── 8. DTP Elements: Banners, Shapes, Badges, Custom Bullets ── */
.kmy-wbanner {
  background: linear-gradient(135deg, #185abd 0%, #0f3d7d 100%);
  color: #ffffff !important;
  padding: 8px 14px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 13pt;
  font-weight: 800;
}

.kmy-wbanner h2 {
  color: #ffffff !important;
  margin: 0;
}

.kmy-wbanner.navy {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.kmy-wbanner.orange {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.kmy-wcallout {
  background: #f8fafc;
  border-left: 4.5px solid #ea580c;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
  margin: 10px 0;
  font-size: 9.5pt;
}

.kmy-wcallout.info {
  border-left-color: #0284c7;
  background: #f0f9ff;
}

.kmy-wcallout.success {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.kmy-wdivider {
  border: none;
  height: 1.5px;
  background: #185abd;
  margin: 10px 0;
}

.kmy-wbadge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 8pt;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin: 2px 4px;
  vertical-align: middle;
}

.kmy-wbadge.gold {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.kmy-wbadge.green {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

/* Custom Bullet Shape Classes */
ul.kmy-bullet-check {
  list-style: none !important;
  padding-left: 18px !important;
  margin: 6px 0 !important;
}

ul.kmy-bullet-check > li {
  position: relative;
  margin-bottom: 4px;
}

ul.kmy-bullet-check > li::before {
  content: "✓ ";
  color: #16a34a;
  font-weight: bold;
  position: absolute;
  left: -18px;
}

ul.kmy-bullet-square {
  list-style: none !important;
  padding-left: 18px !important;
  margin: 6px 0 !important;
}

ul.kmy-bullet-square > li {
  position: relative;
  margin-bottom: 4px;
}

ul.kmy-bullet-square > li::before {
  content: "■ ";
  color: #185abd;
  font-size: 10px;
  position: absolute;
  left: -18px;
  top: 1px;
}

ul.kmy-bullet-arrow {
  list-style: none !important;
  padding-left: 18px !important;
  margin: 6px 0 !important;
}

ul.kmy-bullet-arrow > li {
  position: relative;
  margin-bottom: 4px;
}

ul.kmy-bullet-arrow > li::before {
  content: "➔ ";
  color: #ea580c;
  font-weight: bold;
  position: absolute;
  left: -18px;
}

/* ── 9. Tables & Cell Floating Controls ── */
.kmy-wtable {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 9pt;
  table-layout: fixed;
  page-break-inside: avoid;
}

.kmy-wtable th {
  background: #185abd;
  color: #ffffff;
  padding: 6px 8px;
  border: 0.5pt solid #000000;
  font-weight: 700;
  text-align: left;
}

.kmy-wtable td {
  padding: 5.5px 8px;
  border: 0.5pt solid #000000;
  vertical-align: top;
  word-break: break-word;
}

.kmy-wtable tr:nth-child(even) td {
  background: #f8fafc;
}

.kmy-wtable-float {
  position: absolute;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  z-index: 2500 !important;
}

.kmy-wtable-float button {
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  color: #374151 !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

.kmy-wtable-float button:hover {
  background: #185abd !important;
  color: #ffffff !important;
  border-color: #185abd !important;
}

/* ── 10. Images, 8-Point Live Drag Resizing & Wrap ── */
.kmy-wimg-box {
  display: inline-block;
  position: relative;
  margin: 6px;
  cursor: pointer;
  box-sizing: border-box;
}
.kmy-picture-crop { display: block; position: relative; width: 100%; overflow: hidden; }
.kmy-picture-anchor { display: inline; width: 0; height: 0; }
#kmyPictureCropDialog .kmy-picture-dialog { width: 350px; padding: 20px; font: 13px 'Segoe UI',sans-serif; color: #242424; }
#kmyPictureCropDialog h3 { margin: 0 0 14px; font-size: 16px; }
#kmyPictureCropDialog p { margin: 10px 0; }
#kmyPictureCropDialog label { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; color: #242424; font: inherit; text-transform: none; }
#kmyPictureCropDialog input { width: 90px; }
#kmyPictureCropDialog button { display: inline-block; width: auto; min-width: 75px; height: 28px; margin: 4px 5px 0 0; border: 1px solid #999; border-radius: 2px; background: #fafafa; color: #242424; font: inherit; }
#kmyPictureCropDialog button:first-of-type { background: #185abd; border-color: #185abd; color: white; }
#kmyCropError { color: #b91c1c; }
.kmy-crop-preview { position: relative; margin: 15px auto; overflow: hidden; user-select: none; }
.kmy-crop-preview > img { display: block; width: 100%; height: 100%; pointer-events: none; }
.kmy-crop-frame { position: absolute; border: 1px solid #fff; box-shadow: 0 0 0 300px #0007; box-sizing: border-box; }
.kmy-crop-handle { position: absolute; width: 10px; height: 10px; background: #222; border: 1px solid white; box-sizing: border-box; }
.kmy-crop-nw { left: 0; top: 0; cursor:var(--kmy-visible-nwse-resize); }.kmy-crop-ne { right: 0; top: 0; cursor:var(--kmy-visible-nesw-resize); }
.kmy-crop-sw { left: 0; bottom: 0; cursor:var(--kmy-visible-nesw-resize); }.kmy-crop-se { right: 0; bottom: 0; cursor:var(--kmy-visible-nwse-resize); }
.kmy-crop-n { left: 50%; top: 0; cursor:var(--kmy-visible-ns-resize); }.kmy-crop-s { left: 50%; bottom: 0; cursor:var(--kmy-visible-ns-resize); }
.kmy-crop-w { left: 0; top: 50%; cursor:var(--kmy-visible-ew-resize); }.kmy-crop-e { right: 0; top: 50%; cursor:var(--kmy-visible-ew-resize); }

.kmy-wimg-box img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

.kmy-wimg-box.selected {
  outline: 2px solid #185abd;
  outline-offset: 2px;
}

.kmy-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #ffffff;
  border: 1.5px solid #185abd;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 10001;
  display: none;
}

.kmy-wimg-box.selected .kmy-handle {
  display: block;
}

.kmy-h-nw { top: -5px; left: -5px; cursor:var(--kmy-visible-nwse-resize); }
.kmy-h-ne { top: -5px; right: -5px; cursor:var(--kmy-visible-nesw-resize); }
.kmy-h-se { bottom: -5px; right: -5px; cursor:var(--kmy-visible-nwse-resize); }
.kmy-h-sw { bottom: -5px; left: -5px; cursor:var(--kmy-visible-nesw-resize); }
.kmy-h-n  { top: -5px; left: 50%; transform: translateX(-50%); cursor:var(--kmy-visible-ns-resize); }
.kmy-h-s  { bottom: -5px; left: 50%; transform: translateX(-50%); cursor:var(--kmy-visible-ns-resize); }
.kmy-h-e  { top: 50%; right: -5px; transform: translateY(-50%); cursor:var(--kmy-visible-ew-resize); }
.kmy-h-w  { top: 50%; left: -5px; transform: translateY(-50%); cursor:var(--kmy-visible-ew-resize); }

/* Word 365 Top Rotation Handle */
.kmy-h-rotate-stalk {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 1px;
  height: 18px;
  background: #185abd;
  transform: translateX(-50%);
  display: none;
  z-index: 10001;
}

.kmy-h-rotate {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #16a34a;
  cursor: grab;
  z-index: 10002;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  display: none;
}

.kmy-wimg-box.selected .kmy-h-rotate-stalk,
.kmy-wimg-box.selected .kmy-h-rotate {
  display: block;
}

/* Authentic Word Text Wrapping Modes */
.kmy-wrap-left {
  float: left !important;
  margin: 4px 18px 10px 0 !important;
  clear: left;
}

.kmy-wrap-right {
  float: right !important;
  margin: 4px 0 10px 18px !important;
  clear: right;
}

.kmy-wrap-break {
  display: block !important;
  float: none !important;
  margin: 12px auto !important;
  clear: both !important;
  text-align: center;
}

.kmy-wrap-inline {
  display: inline-block !important;
  float: none !important;
  margin: 4px 8px !important;
  vertical-align: middle !important;
  clear: none !important;
}

.kmy-wrap-float {
  position: absolute !important;
  z-index: 100 !important;
  cursor:var(--kmy-visible-move) !important;
  margin: 0 !important;
  float: none !important;
}

/* Tight / Through wrap (float with tighter gutters) + Behind Text */
.kmy-wrap-tight   { margin: 2px 8px 6px 0 !important; }
.kmy-wrap-through { margin: 2px 6px 4px 0 !important; }
.kmy-wrap-behind {
  position: absolute !important;
  z-index: 1 !important;
  margin: 0 !important;
  float: none !important;
  cursor:var(--kmy-visible-move) !important;
}
/* Text sits above a Behind-Text object */
.kmy-w-a4-page > *:not(.kmy-wimg-box):not(.kmy-floating-shape):not(.kmy-shape-grabframe) { position: relative; z-index: 2; }
.kmy-floating-shape.kmy-shape-behind { z-index: 1 !important; }
/* Behind: centre passes clicks through to the text; edges stay grabbable */
.kmy-floating-shape.kmy-shape-behind { pointer-events: none; }
.kmy-floating-shape.kmy-shape-behind .kmy-shape-handle,
.kmy-floating-shape.kmy-shape-behind .kmy-shape-rot-line { pointer-events: auto; }
/* Grab frame lives in the page ABOVE the text, tracking a behind-text shape */
.kmy-shape-grabframe { position: absolute !important; pointer-events: none; z-index: 50 !important; }
.kmy-shape-grabbar { position: absolute; pointer-events: auto; cursor:var(--kmy-visible-move); }
.kmy-shape-grabbar.t { top: -4px; left: 0; right: 0; height: 11px; }
.kmy-shape-grabbar.b { bottom: -4px; left: 0; right: 0; height: 11px; }
.kmy-shape-grabbar.l { left: -4px; top: 0; bottom: 0; width: 11px; }
.kmy-shape-grabbar.r { right: -4px; top: 0; bottom: 0; width: 11px; }
.kmy-shape-grabbar:hover { background: rgba(24,90,189,0.14); }

/* Word-style Layout Options button (floats at object's top-right) */
.kmy-layout-btn {
  position: fixed;
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: #ffffff;
  border: 1px solid #b9c2cf;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  cursor: pointer;
  z-index: 100010;
}
.kmy-layout-btn:hover { background: #f1f5fb; border-color: #185abd; }

/* Layout Options popup */
.kmy-layout-pop, .kmy-layout-pop * { text-transform: none !important; letter-spacing: 0 !important; }
.kmy-layout-pop {
  position: fixed;
  display: none;
  width: 236px;
  background: #ffffff;
  border: 1px solid #c9d2de;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  padding: 10px 12px 12px;
  z-index: 100011;
  font-size: 12px;
  color: #1e293b;
}
.kmy-lo-head {
  font-weight: 700;
  color: #185abd;
  font-size: 11.5px;
  margin: 6px 0 5px;
}
.kmy-lo-head:first-child { margin-top: 0; }
.kmy-lo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.kmy-lo-grid.one { grid-template-columns: 1fr; width: 68px; }
.kmy-lo-item {
  background: #fff;
  border: 1.5px solid #dfe4ea;
  border-radius: 5px;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kmy-lo-item:hover { border-color: #185abd; background: #f4f8ff; }
.kmy-lo-item.sel { border-color: #185abd; background: #e6f0ff; box-shadow: inset 0 0 0 1px #185abd; }
/* Disabled items must still SWALLOW the click (pointer-events auto) so it never
   falls through the popup to the document behind and deselects the object. */
.kmy-lo-item.disabled { opacity: 0.38; cursor: not-allowed; pointer-events: auto; }
.kmy-lo-note { font-size: 10.5px; color: #64748b; margin-top: 7px; line-height: 1.35; }
.kmy-lo-note b { color: #185abd; }
.kmy-lo-ico svg { width: 40px; height: 30px; }
.kmy-lo-ico svg line { stroke: #9aa4b2; stroke-width: 1.4; stroke-linecap: round; }
.kmy-lo-sep { border-top: 1px solid #e2e8f0; margin: 10px 0 8px; }
.kmy-lo-radio { display: flex; align-items: center; gap: 8px; margin: 7px 0; cursor: pointer; font-size: 12px; line-height: 1.2; }
.kmy-lo-radio input[type="radio"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  margin: 0 !important;
  border: 1.5px solid #9aa4b2 !important;
  border-radius: 50% !important;
  background: #fff !important;
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}
.kmy-lo-radio input[type="radio"]:checked {
  border-color: #185abd !important;
}
.kmy-lo-radio input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #185abd;
}
.kmy-lo-more {
  color: #185abd;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
  text-align: left;
}
.kmy-lo-more:hover { text-decoration: underline; }

/* Image Visual Style Presets */
.kmy-img-shadow img {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18) !important;
}

.kmy-img-border img {
  border: 2px solid #185abd !important;
}

.kmy-img-round img {
  border-radius: 10px !important;
}

/* Image Drag & Drop Feedback */
.kmy-wimg-box[draggable="true"] {
  cursor:var(--kmy-visible-move);
}

.kmy-wimg-box.kmy-img-dragging {
  opacity: 0.45 !important;
  outline: 2px dashed #185abd !important;
}

.kmy-drop-target {
  outline: 2px dashed #16a34a !important;
  outline-offset: 4px;
}

/* Floating Mini-Toolbar */
.kmy-wimg-float {
  position: absolute;
  top: -42px;
  left: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  z-index: 2500 !important;
}

.kmy-wimg-float button {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  padding: 3px 7px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.kmy-wimg-float button:hover {
  background: #185abd !important;
  color: #ffffff !important;
  border-color: #185abd !important;
}

/* Table Column Resizing Visual Guide */
.kmy-col-resize-guide {
  position: absolute;
  width: 2px;
  background: #185abd;
  border-left: 1px dashed #185abd;
  z-index: 2500 !important;
  display: none;
  pointer-events: none;
}

/* ── 11. Floating Resizable & Draggable Text Box (Corel / Word Style) ── */
.kmy-floating-box {
  position: absolute;
  min-width: 150px;
  min-height: 65px;
  background: #ffffff;
  border: 1.5px solid #185abd;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  z-index: 50;
}

.kmy-fbox-header {
  height: 20px;
  background: #185abd;
  cursor:var(--kmy-visible-move);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  user-select: none;
}

.kmy-fbox-close {
  cursor: pointer;
  color: #ffffff;
  font-size: 11px;
  padding: 0 4px;
  border-radius: 2px;
}

.kmy-fbox-close:hover {
  background: #dc2626;
}

.kmy-fbox-body {
  padding: 8px 10px;
  font-size: 9.5pt;
  line-height: 1.35;
  outline: none;
  min-height: 38px;
}

.kmy-fbox-resizer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, #185abd 50%);
}

/* ── 12. Watermark Layer (Strictly Hidden Unless Explicitly Enabled) ── */
.kmy-watermark-layer {
  display: none !important;
}

.kmy-has-watermark .kmy-watermark-layer {
  display: flex !important;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0.08;
  font-weight: 900;
  font-size: 56pt;
  color: #0f172a;
  transform: rotate(-32deg);
  letter-spacing: 8px;
  text-transform: uppercase;
  user-select: none;
}

/* Format Painter Cursor */
.kmy-painter-active, .kmy-painter-active * {
  cursor:var(--kmy-visible-crosshair) !important;
}

/* ── 13. Find & Replace Dialog Modal ── */
.kmy-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100050;
  display: none;
  align-items: center;
  justify-content: center;
}

.kmy-dialog-box {
  background: #ffffff;
  border-radius: 6px;
  width: 440px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  font-family: inherit;
}

.kmy-dialog-header {
  background: #185abd;
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kmy-dialog-close {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 14px !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
}

.kmy-dialog-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kmy-dialog-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kmy-dialog-field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.kmy-dialog-input {
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  background: #ffffff !important;
  color: #111827 !important;
  outline: none !important;
}

.kmy-dialog-input:focus {
  border-color: #185abd !important;
  box-shadow: 0 0 0 2px rgba(24, 90, 189, 0.15) !important;
}

.kmy-dialog-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #4b5563;
}

.kmy-find-status {
  font-weight: 600;
  color: #185abd;
}

.kmy-dialog-foot {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.kmy-dialog-foot button {
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  color: #374151 !important;
  padding: 5px 12px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.kmy-dialog-foot button.primary {
  background: #185abd !important;
  color: #ffffff !important;
  border-color: #185abd !important;
}

/* ── 13B. Word 365 Authentic Dialog Modals & Fluent UI Engine ── */
@keyframes kmyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes kmyDialogPop {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes kmyPopSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes kmyDrawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.kmy-w365-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(1.5px);
  z-index: 100060;
  display: none;
  align-items: center;
  justify-content: center;
  animation: kmyFadeIn 0.15s ease;
}

.kmy-w365-dialog {
  background: #fdfdfd;
  border: 1px solid #c7c7c7;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 95vw;
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Calibri, sans-serif;
  color: #1f2937;
  animation: kmyDialogPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.kmy-w365-titlebar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 14px;
  user-select: none;
}

.kmy-w365-title {
  font-size: 12px;
  font-weight: 600;
  color: #201f1e;
  letter-spacing: 0.1px;
}

.kmy-w365-controls {
  display: flex;
  align-items: center;
}

.kmy-w365-ctrl-btn {
  background: transparent !important;
  border: none !important;
  color: #5c5b5a !important;
  width: 32px !important;
  height: 30px !important;
  font-size: 13px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 2px !important;
  transition: all 0.1s ease !important;
}

.kmy-w365-ctrl-btn:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
}

.kmy-w365-ctrl-btn.close:hover {
  background: #e81123 !important;
  color: #ffffff !important;
}

.kmy-w365-tabs {
  background: #f3f3f3;
  border-bottom: 1px solid #d1d5db;
  display: flex;
  align-items: flex-end;
  padding: 6px 14px 0 14px;
  gap: 4px;
}

.kmy-w365-tab {
  background: #e5e7eb !important;
  border: 1px solid #d1d5db !important;
  border-bottom: none !important;
  border-radius: 4px 4px 0 0 !important;
  padding: 5px 14px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #4b5563 !important;
  cursor: pointer !important;
  margin-bottom: -1px !important;
  transition: all 0.1s ease !important;
}

.kmy-w365-tab:hover {
  background: #f0f0f0 !important;
  color: #111827 !important;
}

.kmy-w365-tab.active {
  background: #ffffff !important;
  color: #111827 !important;
  font-weight: 600 !important;
  border-color: #d1d5db !important;
  border-bottom: 1px solid #ffffff !important;
  z-index: 2 !important;
}

.kmy-w365-body {
  background: #ffffff;
  overflow-y: auto;
  max-height: calc(94vh - 80px);
}

.kmy-w365-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #004578;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kmy-w365-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e1dfdd;
}

.kmy-w365-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #323130;
  gap: 8px;
}

.kmy-w365-label {
  font-size: 11.5px;
  color: #323130;
  white-space: nowrap;
}

.kmy-w365-spin-wrap {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #8a8886;
  border-radius: 2px;
  height: 24px;
  padding-right: 2px;
}

.kmy-w365-spin-wrap:focus-within {
  border-color: #005a9e;
  box-shadow: 0 0 0 1px #005a9e;
}

.kmy-w365-spin-wrap input {
  border: none !important;
  outline: none !important;
  padding: 0 4px !important;
  width: 54px !important;
  height: 22px !important;
  font-size: 11.5px !important;
  font-family: inherit !important;
  text-align: right !important;
  background: transparent !important;
  color: #111827 !important;
}

.kmy-w365-spin-unit {
  font-size: 11px;
  color: #605e5c;
  padding-right: 4px;
  user-select: none;
}

.kmy-w365-select {
  height: 24px !important;
  border: 1px solid #8a8886 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  font-size: 11.5px !important;
  padding: 0 6px !important;
  color: #201f1e !important;
  outline: none !important;
  min-width: 90px !important;
  cursor: pointer !important;
}

.kmy-w365-select:focus {
  border-color: #005a9e !important;
  box-shadow: 0 0 0 1px #005a9e !important;
}

/* Word 365 Dialog Isolation & Control Resets (Immune to CRM dark-theme & global inputs) */
.kmy-w365-overlay .kmy-w365-dialog,
.kmy-w365-dialog {
  background: #fdfdfd !important;
  color: #201f1e !important;
  box-sizing: border-box !important;
}

.kmy-w365-check {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 11.5px !important;
  color: #201f1e !important;
  cursor: pointer !important;
  user-select: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.kmy-w365-dialog input[type="checkbox"],
.kmy-w365-check input[type="checkbox"],
.kmy-w365-dialog input[type="radio"],
.kmy-w365-check input[type="radio"] {
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  padding: 0 !important;
  margin: 0 4px 0 0 !important;
  border: 1px solid #797775 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  accent-color: #005a9e !important;
  cursor: pointer !important;
  display: inline-block !important;
  vertical-align: middle !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
}

.kmy-w365-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
.kmy-w365-dialog select,
.kmy-w365-dialog .kmy-dialog-input,
.kmy-w365-dialog .kmy-w365-select {
  background: #ffffff !important;
  color: #201f1e !important;
  border: 1px solid #8a8886 !important;
  border-radius: 2px !important;
  min-height: 22px !important;
  height: 22px !important;
  padding: 2px 6px !important;
  font-size: 11.5px !important;
  font-family: 'Segoe UI', Calibri, Arial, sans-serif !important;
  box-shadow: none !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.kmy-w365-dialog input:not([type="checkbox"]):not([type="radio"]):focus,
.kmy-w365-dialog select:focus,
.kmy-w365-dialog .kmy-dialog-input:focus,
.kmy-w365-dialog .kmy-w365-select:focus {
  border-color: #005a9e !important;
  box-shadow: 0 0 0 1px #005a9e !important;
}

.kmy-w365-dialog .kmy-w365-listbox {
  background: #ffffff !important;
  color: #201f1e !important;
  border: 1px solid #8a8886 !important;
}

.kmy-w365-dialog .kmy-w365-list-item {
  color: #201f1e !important;
  background: #ffffff !important;
}

.kmy-w365-dialog .kmy-w365-list-item:hover {
  background: #e5f1fb !important;
  color: #000000 !important;
}

.kmy-w365-dialog .kmy-w365-list-item.selected {
  background: #cde6f7 !important;
  color: #000000 !important;
}

.kmy-w365-preview-box {
  background: #ffffff;
  border: 1px solid #a19f9d;
  padding: 8px 12px;
  min-height: 90px;
  max-height: 115px;
  overflow: hidden;
  font-family: Calibri, sans-serif;
  font-size: 7.5pt;
  color: #201f1e;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.kmy-w365-prev-dummy {
  color: #a19f9d;
  line-height: 1.15;
}

.kmy-w365-prev-active {
  color: #000000;
  font-weight: 500;
  background: rgba(0, 90, 158, 0.05);
  border: 1px dashed rgba(0, 90, 158, 0.25);
  padding: 2px 4px;
  margin: 3px 0;
  transition: all 0.1s ease;
}

.kmy-w365-foot {
  background: #f3f3f3;
  border-top: 1px solid #e1dfdd;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kmy-w365-btn {
  background: #ffffff !important;
  border: 1px solid #8a8886 !important;
  border-radius: 2px !important;
  color: #201f1e !important;
  min-width: 74px !important;
  height: 25px !important;
  padding: 0 12px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.1s ease !important;
}

.kmy-w365-btn:hover {
  background: #f3f2f1 !important;
  border-color: #323130 !important;
}

.kmy-w365-btn.primary {
  background: #005a9e !important;
  border-color: #005a9e !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.kmy-w365-btn.primary:hover {
  background: #004578 !important;
  border-color: #004578 !important;
}

.kmy-w365-drawer {
  position: fixed;
  right: 0;
  top: 126px;
  bottom: 28px;
  width: 260px;
  background: #ffffff;
  border-left: 1px solid #d1d5db;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  z-index: 100040;
  display: none;
  flex-direction: column;
  animation: kmyDrawerSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kmy-w365-drawer-head {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kmy-w365-drawer-body {
  padding: 10px 12px;
  flex: 1;
  overflow-y: auto;
}

.kmy-styles-drawer-item {
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.kmy-styles-drawer-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.kmy-w365-drawer-foot {
  padding: 8px 12px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}

/* ── 14. Symbols Popover ── */
.kmy-symbol-popover {
  width: 330px;
  padding: 10px 12px;
  max-height: 380px;
  overflow-y: auto;
}

.kmy-sym-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  margin: 6px 0 4px;
}

.kmy-symbol-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.kmy-sym-btn {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  height: 30px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.1s ease !important;
}

.kmy-sym-btn:hover {
  background: #185abd !important;
  color: #ffffff !important;
  border-color: #185abd !important;
}

/* ── 15. Word 365 Bottom Status Bar with Zoom Slider ── */
.kmy-w-statusbar {
  background: #f3f2f1;
  border-top: 1px solid #e1dfdd;
  color: #484644;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11.5px;
  font-weight: 500;
  flex-shrink: 0;
}

.kmy-w-status-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kmy-w-status-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kmy-zoom-slider-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kmy-zoom-slider-box input[type="range"] {
  width: 100px;
  height: 4px;
  cursor: pointer;
  accent-color: #185abd;
}

/* ── 15. Office 365 Color Picker, Underline & Styles Gallery ── */
.kmy-office-color-picker {
  padding: 8px 10px;
  width: 210px;
  user-select: none;
}

.kmy-color-title {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.kmy-color-auto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 500;
  color: #1e293b;
}

.kmy-color-auto-row:hover {
  background: #f1f5f9;
}

.kmy-theme-color-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.kmy-theme-color-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kmy-color-chip {
  width: 17px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 1px;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.1s ease;
}

.kmy-color-chip:hover {
  outline: 1.5px solid #185abd;
  outline-offset: 1px;
  transform: scale(1.18);
  z-index: 5;
}

.kmy-color-chip.standard {
  width: 17px;
  height: 16px;
  border-radius: 2px;
}

.kmy-standard-color-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}

/* Word 365 Underline Styles Popover (Zero Scrollbars & Clean View-Switch) */
.kmy-underline-popover {
  padding: 6px 0 !important;
  width: 235px !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
  box-sizing: border-box !important;
}

.kmy-underline-back-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #185abd;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.1s ease;
}

.kmy-underline-back-row:hover {
  background: #f0f7ff;
}

.kmy-underline-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.kmy-underline-opt:hover {
  background: #f0f7ff;
}

.kmy-u-sample {
  width: 100%;
  height: 0;
  border-bottom: 1.5px solid #1e293b;
}

.kmy-u-sample.double {
  border-bottom: 3.5px double #1e293b;
}

.kmy-u-sample.thick {
  border-bottom: 3px solid #1e293b;
}

.kmy-u-sample.dotted {
  border-bottom: 2px dotted #1e293b;
}

.kmy-u-sample.dashed {
  border-bottom: 2px dashed #1e293b;
}

.kmy-u-sample.dotDash {
  border-bottom: 2px dashed #1e293b;
}

.kmy-u-sample.dotDotDash {
  border-bottom: 2px dashed #1e293b;
}

.kmy-u-sample.wavy {
  border-bottom: none;
  height: 6px;
  background: radial-gradient(circle at 3px 2px, #1e293b 1.2px, transparent 0) repeat-x;
  background-size: 6px 4px;
}

.kmy-underline-item {
  padding: 6px 14px;
  font-size: 11.5px;
  color: #201f1e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s ease;
}

.kmy-underline-item:hover {
  background: #f0f7ff;
  color: #185abd;
}

/* ── Word 365 Bullet Library Popover (Image 4 Match) ── */
.kmy-bullet-lib-pop {
  width: 245px !important;
  padding: 8px 10px !important;
}

.kmy-bullet-lib-title {
  font-size: 11px;
  font-weight: 700;
  color: #201f1e;
  margin-bottom: 6px;
  padding-left: 2px;
}

.kmy-bullet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.kmy-bullet-tile {
  width: 50px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}

.kmy-bullet-tile:hover {
  background: #f0f7ff;
  border-color: #185abd;
  box-shadow: 0 1px 4px rgba(24, 90, 189, 0.15);
}

.kmy-bullet-tile.active {
  border-color: #185abd !important;
  background: #e0edfe !important;
  box-shadow: inset 0 0 0 1px #185abd;
}

.kmy-bullet-symbol {
  font-size: 16px;
  line-height: 1;
  color: #1e293b;
}

.kmy-bullet-none-text {
  font-size: 11px;
  color: #334155;
  font-weight: 500;
}

/* Word 365 Quick Styles Gallery */
.kmy-styles-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0;
  max-width: 320px;
}

.kmy-style-card {
  min-width: 68px;
  height: 52px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.kmy-style-card:hover {
  border-color: #185abd;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.kmy-style-card.active {
  border-color: #185abd;
  outline: 2px solid #93c5fd;
  background: #eff6ff;
}

.kmy-style-card-preview {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Word 365 Split Buttons */
.kmy-w-split-btn {
  display: inline-flex !important;
  align-items: stretch !important;
  border-radius: 3px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
}

.kmy-w-split-btn:hover {
  background: #edebe9 !important;
  border-color: #cbd5e1 !important;
}

.kmy-w-split-btn > .kmy-btn-tool {
  border-radius: 3px 0 0 3px !important;
  border: none !important;
  margin: 0 !important;
}

.kmy-w-split-btn > .kmy-btn-tool.kmy-split-arrow {
  border-radius: 0 3px 3px 0 !important;
  border: none !important;
  border-left: 1px solid rgba(0, 0, 0, 0.12) !important;
  width: 14px !important;
  min-width: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.kmy-w-split-btn:hover > .kmy-btn-tool:hover {
  background: #e1dfdd !important;
}

/* ── 15. Authentic Word 365 Shapes Engine & Floating Objects ── */
.kmy-floating-shape {
  position: absolute;
  min-width: 40px;
  min-height: 30px;
  cursor:var(--kmy-visible-move);
  user-select: none;
  z-index: 100;
  box-sizing: border-box;
}

.kmy-floating-shape.selected {
  outline: 1px solid #c4c4c4 !important;
  outline-offset: 0;
}

/* Thin, crisp shape outline like Word (not a thick cartoon border) */
.kmy-floating-shape .kmy-shape-svg > * {
  stroke-width: 1.4px;
}

.kmy-floating-shape:not(.selected) .kmy-shape-handle,
.kmy-floating-shape:not(.selected) .kmy-shape-rot-line {
  display: none !important;
}

.kmy-shape-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.kmy-shape-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: Calibri, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  padding: 8px 12px;
  box-sizing: border-box;
  outline: none;
  cursor:var(--kmy-visible-text);
  word-break: break-word;
  user-select: text;
  overflow: hidden;
}

.kmy-shape-text:empty:before {
  content: attr(placeholder);
  color: #94a3b8;
  font-weight: normal;
  font-style: italic;
  font-size: 11px;
}

/* 8 Resize Handles */
.kmy-shape-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #ffffff;
  border: 1px solid #a0a0a0;
  border-radius: 50%;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
  z-index: 105;
}

.kmy-shape-handle.nw { top: -4.5px; left: -4.5px; cursor:var(--kmy-visible-nwse-resize); }
.kmy-shape-handle.n  { top: -4.5px; left: calc(50% - 4.5px); cursor:var(--kmy-visible-ns-resize); }
.kmy-shape-handle.ne { top: -4.5px; right: -4.5px; cursor:var(--kmy-visible-nesw-resize); }
.kmy-shape-handle.e  { top: calc(50% - 4.5px); right: -4.5px; cursor:var(--kmy-visible-ew-resize); }
.kmy-shape-handle.se { bottom: -4.5px; right: -4.5px; cursor:var(--kmy-visible-nwse-resize); }
.kmy-shape-handle.s  { bottom: -4.5px; left: calc(50% - 4.5px); cursor:var(--kmy-visible-ns-resize); }
.kmy-shape-handle.sw { bottom: -4.5px; left: -4.5px; cursor:var(--kmy-visible-nesw-resize); }
.kmy-shape-handle.w  { top: calc(50% - 4.5px); left: -4.5px; cursor:var(--kmy-visible-ew-resize); }

/* Rotation stalk & handle */
.kmy-shape-rot-line {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 1px;
  height: 16px;
  background: #c4c4c4;
  z-index: 104;
}

.kmy-shape-handle.rot {
  top: -30px;
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #9a9a9a;
  cursor: grab;
  z-index: 105;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a9 9 0 1 1-3-6.7'/><polyline points='21 3 21 8 16 8'/></svg>");
  background-size: 10px 10px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Floating Shape Mini-Toolbar */
.kmy-shape-toolbar {
  position: fixed;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 4px 8px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 2500 !important;
  max-width: 96vw;
}
.kmy-sf-row {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  font-size: 11.5px;
}
.kmy-sf-lbl {
  font-weight: 700;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin: 0 2px 0 4px;
}
.kmy-sf-sep {
  border-left: 1px solid #d7dee7;
  height: 18px;
  margin: 0 3px;
}
.kmy-style-swatch span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 18px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: Calibri, "Segoe UI", sans-serif;
}
.kmy-sf-weight {
  font-size: 11px;
  height: 22px;
  padding: 1px 3px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}
/* Shape Format pane: keep every group strictly inside the ribbon height */
#kmyPane_shapeformat .kmy-w-group-tools { gap: 4px; }
#kmyPane_shapeformat .kmy-w-row { min-height: 24px; }
#kmyPane_shapeformat .kmy-btn-tool { height: 22px !important; }
.kmy-sf-inl {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
/* Contextual "Shape Format" ribbon tab (Word tints it) */
.kmy-w-tab-context {
  color: #b45309 !important;
  font-weight: 700;
}
.kmy-w-tab-context.active {
  color: #92400e !important;
  box-shadow: inset 0 -2.5px 0 #d97706;
}

/* Categorized Shapes Gallery in Ribbon Popover */
.kmy-shapes-gallery {
  padding: 8px;
  width: 330px;
  max-height: 440px;
  overflow-y: auto;
}

.kmy-shapes-cat-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 6px 0 4px 2px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 2px;
}

.kmy-shapes-cat-title:first-child {
  margin-top: 0;
}

.kmy-shapes-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.kmy-shape-btn {
  width: 44px;
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  cursor: pointer;
  padding: 2px;
  transition: all 0.12s ease;
}

.kmy-shape-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24, 90, 189, 0.15);
}

.kmy-shape-btn svg {
  width: 28px;
  height: 24px;
  pointer-events: none;
}

/* Free-Floating Images Support */
.kmy-wimg-box.kmy-wrap-float {
  position: absolute !important;
  z-index: 80 !important;
  cursor:var(--kmy-visible-move) !important;
}

.kmy-wimg-box.kmy-wrap-float img {
  pointer-events: none;
}

/* ── 16. Print Engine (100% 1:1 Match) ── */
@media print {
  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app, .modalbg, .top, .side, .toast,
  .kmy-w-titlebar, .kmy-w-tabbar, .kmy-w-ribbon-body,
  .kmy-w-top-ruler-bar, .kmy-w-vruler, .kmy-w-statusbar,
  .kmy-page-tag, .kmy-page-del, .kmy-wimg-float, .kmy-wtable-float, .kmy-shape-toolbar, .kmy-popover, .kmy-handle,
  .kmy-shape-handle, .kmy-shape-rot-line,
  .kmy-dialog-overlay, .kmy-fbox-header, .kmy-fbox-resizer {
    display: none !important;
  }

  .kmy-word-app {
    position: static !important;
    background: #ffffff !important;
    display: block !important;
  }

  .kmy-w-workspace {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    transform: none !important;
  }

  .kmy-w-stage {
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    transform: none !important;
  }

  .kmy-w-page-row {
    display: block !important;
  }

  .kmy-w-canvas {
    width: 210mm !important;
    transform: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }

  .kmy-landscape @page {
    size: A4 landscape;
  }

  .kmy-w-a4-page {
    width: 210mm !important;
    min-height: 297mm !important;
    max-width: 210mm !important;
    height: 297mm !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 12.7mm 15mm !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    overflow: hidden !important;
  }

  .kmy-landscape .kmy-w-a4-page {
    width: 297mm !important;
    min-height: 210mm !important;
    max-width: 297mm !important;
    height: 210mm !important;
  }

  .kmy-w-a4-page:last-child {
    page-break-after: auto !important;
  }

  .kmy-w-header, .kmy-w-footer {
    border-color: transparent !important;
  }

  .kmy-w-header::before, .kmy-w-footer::before {
    display: none !important;
  }
}

/* Word-like shapes: body is draggable; text only editable after double-click */
.kmy-floating-shape { cursor:var(--kmy-visible-move); }
.kmy-floating-shape .kmy-shape-text { pointer-events: none; cursor:var(--kmy-visible-move); }
.kmy-floating-shape.kmy-editing .kmy-shape-text { pointer-events: auto; cursor:var(--kmy-visible-text); }
.kmy-floating-shape.kmy-editing { cursor:var(--kmy-visible-text); }

/* Roundness adjuster handle (Word's yellow diamond) */
.kmy-floating-shape .kmy-shape-handle.round {
  position: absolute; width: 11px; height: 11px; background: #ffd21f;
  border: 1.5px solid #d9a400; border-radius: 2px; transform: rotate(45deg);
  cursor:var(--kmy-visible-ew-resize); z-index: 60; pointer-events: auto;
}
.kmy-floating-shape .kmy-shape-handle.round:hover { background: #ffdd4a; }

/* Draw-by-drag: crosshair cursor while a shape is armed for drawing */
.kmy-drawing-shape, .kmy-drawing-shape * { cursor:var(--kmy-visible-crosshair) !important; }

/* Uniform outline thickness on shapes regardless of non-uniform scaling (Word-like) */
.kmy-floating-shape .kmy-shape-svg * { vector-effect: non-scaling-stroke; }


/* Editor chrome is deliberately scoped away from editable document content. */
.kmy-wtable.kmy-table-plain { font: inherit; table-layout: fixed; border-collapse: collapse; }
.kmy-wtable.kmy-table-plain td, .kmy-wtable.kmy-table-plain th { background: transparent; color: inherit; font-weight: normal; padding: 0 1.9mm; border: 0.5pt solid #000; vertical-align: top; }
.kmy-wtable.kmy-table-plain tr:nth-child(even) td { background: transparent; }
.kmy-wtable.kmy-table-plain td > p, .kmy-wtable.kmy-table-plain th > p { margin: 0; min-height: 1.2em; }
.kmy-cell-selected { box-shadow: inset 0 0 0 9999px #185abd25; outline: 1px solid #185abd; outline-offset: -1px; }
#kmyWordApp .kmy-table-style-gallery button { display: flex; flex-direction: column; height: 60px; gap: 2px; }
#kmyWordApp .kmy-table-style-preview { font-size: 32px; line-height: 34px; color: #555; }
#kmyWordApp .kmy-table-style-preview.banded { background: repeating-linear-gradient(#fff 0 8px,#e8eef7 8px 16px); }
#kmyWordApp .kmy-table-style-preview.blue { color: #185abd; }
#kmyWordApp .kmy-table-align-grid { display: grid; grid-template-columns: repeat(3,26px); gap: 0; }
#kmyWordApp .kmy-table-align-grid button { height: 22px; min-height: 22px; padding: 0; }
#kmyWordApp .kmy-table-options { display: grid; grid-template-columns: repeat(2,auto); grid-template-rows: repeat(3,22px); gap: 2px 15px; padding: 2px; }
#kmyWordApp .kmy-w-ribbon-body { min-height: 120px; max-height: 120px; }
#kmyWordApp .kmy-table-options label { display: flex; align-items: center; gap: 6px; }
#kmyWordApp .kmy-table-options input { width: 14px!important; height: 14px!important; min-height: 14px!important; padding: 0!important; margin: 0!important; accent-color: #185abd; }
#kmyWordApp .kmy-table-gallery { display: flex; gap: 4px; align-items: center; height: 72px; }
#kmyWordApp .kmy-theme-card { padding: 7px; height: 73px; border: 1px solid transparent; }
#kmyWordApp .kmy-theme-card.active { border-color: #185abd; background: #e8eef7; }
#kmyWordApp .kmy-theme-preview { display: grid; grid-template-columns: repeat(4,15px); grid-template-rows: repeat(5,9px); gap: 1px; padding: 1px; background: var(--table-accent); }
#kmyWordApp .kmy-theme-preview i { display: block; }
#kmyWordApp .kmy-table-pen { display: flex; flex-direction: column; gap: 4px; width: 140px; }
#kmyWordApp #kmyPane_tabledesign .kmy-table-pen select { height: 22px!important; min-height: 22px!important; max-height: 22px!important; }
#kmyWordApp .kmy-table-palette input { background: white!important; color: #242424!important; height: 25px!important; min-height: 25px!important; border: 1px solid #aaa!important; border-radius: 2px!important; padding: 2px 4px!important; }
#kmyWordApp .kmy-table-color-chip { display: inline-block; width: 25px; height: 5px; border: 1px solid #aaa; background: transparent; }
#kmyWordApp .kmy-table-palette { width: 240px; padding: 10px; color: #242424; background: white; }
#kmyWordApp .kmy-table-palette strong { display: block; margin: 4px 0 8px; font: 600 12px 'Segoe UI',sans-serif; }
#kmyWordApp .kmy-table-colors { display: grid; grid-template-columns: repeat(10,18px); gap: 4px; margin-bottom: 12px; }
#kmyWordApp .kmy-table-colors .kmy-color-swatch { display: block; width: 18px!important; height: 18px!important; min-height: 18px; padding: 0!important; margin: 0; border: 1px solid #bbb; border-radius: 0; cursor: pointer; }
#kmyWordApp .kmy-color-swatch:hover { outline: 2px solid #f4b183; outline-offset: 1px; }
#kmyWordApp .kmy-table-palette label { display: flex; gap: 5px; align-items: center; margin-top: 8px!important; }
#kmyWordApp .kmy-table-icon { width: 32px; height: 32px; flex-shrink: 0; }
#kmyWordApp #kmyPane_tablelayout .kmy-btn-tool:has(.kmy-table-icon) { display: flex; flex-direction: column; justify-content: center; gap: 3px; height: 78px; white-space: normal; max-width: 85px; text-align: center; }
#kmyWordApp #kmyPane_tablelayout .kmy-w-group-tools:has(.kmy-table-icon) { display: flex; flex-direction: row; }
#kmyWordApp #kmyPane_tablelayout .kmy-w-row:has(.kmy-table-icon) { display: flex; height: auto; align-items: center; }
#kmyWordApp .kmy-table-align-grid { grid-template-columns: repeat(3,30px); gap: 2px; }
#kmyWordApp .kmy-table-align-grid button { width: 30px; height: 27px; }
#kmyWordApp .kmy-table-align-grid svg { width: 27px; height: 27px; }
#kmyWordApp .kmy-table-border-menu { min-width: 180px; padding: 4px; }
#kmyWordApp .kmy-table-border-menu button { display: flex; width: 100%; align-items: center; gap: 9px; }
#kmyWordApp .kmy-table-border-menu svg { width: 20px; height: 20px; }
#kmyWordApp #kmyPane_tablelayout { gap: 0; }
#kmyWordApp #kmyPane_tablelayout .kmy-w-group { padding: 0 8px; }
#kmyWordApp .kmy-word-table-tools { display: flex; align-items: flex-start; gap: 2px; height: 83px; }
#kmyWordApp #kmyPane_tablelayout .kmy-word-table-button { display: flex!important; flex-direction: column!important; align-items: center!important; justify-content: flex-start!important; height: 82px!important; min-height: 82px!important; max-height: 82px!important; min-width: 46px; max-width: 76px; padding: 3px 4px!important; gap: 5px; font: 12px/15px 'Segoe UI',sans-serif; white-space: nowrap; text-align: center; }
#kmyWordApp .kmy-word-table-icon { width: 32px; height: 32px; flex-shrink: 0; }
#kmyWordApp .kmy-menu-caret { display: block; line-height: 10px; }
#kmyWordApp .kmy-word-cell-size { display: flex; flex-direction: column; gap: 8px; padding: 5px 3px; }
#kmyWordApp .kmy-word-cell-size > div { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
#kmyWordApp .kmy-word-cell-size label { width: 57px; }
#kmyWordApp .kmy-word-cell-size input { width: 62px!important; }
#kmyWordApp .kmy-word-cell-size .kmy-btn-tool { display: flex; align-items: center; gap: 3px; font-size: 12px; }
#kmyWordApp .kmy-word-cell-size svg { width: 18px; height: 18px; }
#kmyWordApp #kmyPane_tablelayout .kmy-table-align-grid { display: grid; padding-top: 1px; }
.kmy-table-gridlines td,.kmy-table-gridlines th { outline: 1px dotted #aab7c4; outline-offset: -1px; }
@media print { .kmy-table-gridlines td,.kmy-table-gridlines th { outline: none; } .kmy-wtable thead { display: table-header-group; } }
#kmyTableSettingsDialog .kmy-table-settings { width: 350px; padding: 20px; font: 13px 'Segoe UI',sans-serif; color: #242424; }
#kmyTableSettingsDialog h3 { margin: 0 0 15px; }
#kmyTableSettingsDialog label { display: block; margin: 10px 0 4px; text-transform: none; color: #242424; font: inherit; }
#kmyTableSettingsDialog input:not([type=checkbox]),#kmyTableSettingsDialog select { width: 100%; }
#kmyTableSettingsDialog button { display: inline-block; min-width: 70px; width: auto; padding: 5px 12px; background: #f9f9f9; color: #242424; border: 1px solid #999; margin: 12px 5px 0 0; }
#kmyTableSettingsError { color: #b91c1c; }
#kmyWordApp #kmyPane_tabledesign label, #kmyWordApp #kmyPane_tablelayout label { font: 12px "Segoe UI",sans-serif; text-transform: none; letter-spacing: normal; color: #242424; margin: 0; white-space: nowrap; }
#kmyWordApp #kmyPane_tabledesign input[type="color"] { width: 30px; height: 24px; min-height: 24px; padding: 2px; background: white; border: 1px solid #b8b8b8; }
@media print { .kmy-cell-selected { box-shadow: none; outline: none; } }
#kmySplitCellsDialog .kmy-w365-dialog { color: #242424; font: 13px 'Segoe UI', sans-serif; }
#kmySplitCellsDialog h3 { margin: 0 0 18px; font-size: 15px; }
#kmySplitCellsDialog label { display: block; color: #242424; font-size: 13px; font-weight: 400; text-transform: none; margin-bottom: 5px; }
#kmySplitCellsDialog p { margin: 0 0 14px; }
#kmySplitCellsDialog input { box-sizing: border-box; width: 100%; height: 28px; background: white; color: #242424; border: 1px solid #999; border-radius: 2px; padding: 3px 6px; }
#kmySplitCellsDialog button { display: inline-block; width: auto; min-width: 75px; height: 28px; margin: 4px 4px 0 0; padding: 3px 15px; border: 1px solid #999; border-radius: 2px; background: #fafafa; color: #242424; font: inherit; }
#kmySplitCellsDialog button:first-of-type { border-color: #185abd; background: #185abd; color: white; }
#kmyWordApp {
  color-scheme: light;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  --editor-border: #d1d1d1;
  --editor-hover: #e8eef7;
}
#kmyWordApp .kmy-w-titlebar {
  height: 44px;
  min-height: 44px;
  flex-shrink: 0;
  gap: 16px;
  background: #f3f3f5;
}
#kmyWordApp .kmy-w-title-left { min-width: 0; flex: 1 1 auto; }
#kmyWordApp .kmy-w-autosave-toggle { flex-shrink: 0; white-space: nowrap; }
#kmyWordApp .kmy-w-doc-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 80px;
}
#kmyWordApp .kmy-w-title-center { flex: 0 1 320px; min-width: 120px; }
#kmyWordApp .kmy-w-title-right { flex: 0 0 auto; gap: 6px; }
#kmyWordApp .kmy-w-search-bar {
  height: 30px !important;
  min-height: 30px !important;
  border-radius: 5px !important;
  padding: 0 8px !important;
}
#kmyWordApp .kmy-w-search-bar input {
  height: 28px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #242424 !important;
  font: 12px "Segoe UI", sans-serif !important;
}
#kmyWordApp .kmy-w-ribbon-pane input[type="number"],
#kmyWordApp .kmy-w-ribbon-pane input[type="text"],
#kmyWordApp .kmy-w-ribbon-pane select {
  color-scheme: light !important;
  background: #fff !important;
  color: #242424 !important;
  border: 1px solid #b8b8b8 !important;
  border-radius: 3px !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 2px 6px !important;
  margin: 0 !important;
  font: 12px "Segoe UI", sans-serif !important;
  box-shadow: none !important;
}
#kmyWordApp .kmy-w-ribbon-pane input:focus-visible,
#kmyWordApp .kmy-w-ribbon-pane select:focus-visible {
  outline: 2px solid #185abd !important;
  outline-offset: 1px;
}
#kmyWordApp .kmy-w-ribbon-pane.active .kmy-w-group { animation: none; }
#kmyWordApp .kmy-w-group { padding: 0 10px; border-color: var(--editor-border); }
#kmyWordApp .kmy-w-group-title { font: 11px "Segoe UI", sans-serif; color: #616161; }
#kmyWordApp .kmy-btn-tool { border-radius: 3px; font-family: "Segoe UI", sans-serif; }
#kmyWordApp .kmy-btn-tool:hover { background: var(--editor-hover); }
#kmyWordApp .kmy-w-tab { font-family: "Segoe UI", sans-serif; }
#kmyWordApp .kmy-w-statusbar { font: 12px "Segoe UI", sans-serif; }
#kmyWordApp .kmy-w-ribbon-body { overflow-x: auto !important; overflow-y: hidden !important; scrollbar-width: thin; }
#kmyWordApp .kmy-w-ribbon-pane { width: max-content; min-width: 100%; }
#kmyWordApp #kmyPane_pictureformat label { color: #242424; font-size: 12px; white-space: nowrap; text-transform: none; letter-spacing: normal; font-weight: 400; margin: 0; }
#kmyWordApp #kmyPicLock { width: 14px; height: 14px; margin: 0 4px 0 0; vertical-align: middle; accent-color: #185abd; }
#kmyWordApp #kmySfStylesRow button { min-width: 42px; height: 34px; }
#kmyWordApp #kmySfStylesRow { gap: 5px !important; }
/* Dialogs live beside the editor, so explicitly beat CRM's dark-theme rules. */
:root .kmy-w365-overlay .kmy-w365-dialog input:not([type="checkbox"]):not([type="radio"]),
:root .kmy-w365-overlay .kmy-w365-dialog select,
:root .kmy-w365-overlay .kmy-w365-dialog textarea,
:root .kmy-dialog-overlay .kmy-dialog-box input:not([type="checkbox"]):not([type="radio"]),
:root .kmy-dialog-overlay .kmy-dialog-box select {
  color-scheme: light !important;
  color: #242424 !important;
  background: #fff !important;
  border: 1px solid #a6a6a6 !important;
  border-radius: 2px !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 6px !important;
  font: 12px "Segoe UI", sans-serif !important;
  box-shadow: none !important;
}
@media screen and (max-width: 1100px) {
  #kmyWordApp .kmy-w-title-center { display: none; }
  #kmyWordApp .kmy-w-titlebar { padding-inline: 8px; gap: 8px; }
}

/* Word-style Table Design controls and table selection/move handle. */
#kmyWordApp #kmyPane_tabledesign {gap:0;}
#kmyWordApp #kmyPane_tabledesign .kmy-w-group {padding:0 10px;}
#kmyWordApp #kmyPane_tabledesign .kmy-table-options {column-gap:16px;row-gap:10px;}
#kmyWordApp #kmyPane_tabledesign .kmy-table-gallery {gap:4px;}
#kmyWordApp #kmyPane_tabledesign .kmy-theme-card {padding:5px;width:72px;min-width:72px;border:1px solid transparent;border-radius:0;}
#kmyWordApp #kmyPane_tabledesign .kmy-theme-card.active {border-color:#aaa;box-shadow:inset 0 0 0 3px #eee;}
#kmyWordApp #kmyPane_tabledesign .kmy-theme-preview {width:60px;height:48px;}
#kmyWordApp #kmyPane_tabledesign .big-btn {min-width:60px;gap:4px;font-weight:400;font-size:12px;}
#kmyWordApp #kmyPane_tabledesign .big-btn>svg {width:32px;height:32px;}
#kmyWordApp #kmyPane_tabledesign .kmy-w-row {gap:4px;align-items:flex-start;}
#kmyWordApp #kmyPane_tabledesign .kmy-table-pen {width:136px;gap:4px;}
#kmyWordApp #kmyPane_tabledesign .kmy-table-pen>select {width:136px;}
#kmyWordApp #kmyPane_tabledesign .kmy-table-pen button svg {width:22px;height:22px;}
#kmyWordApp #kmyTablePenChip {width:16px;height:3px;position:absolute;left:4px;bottom:2px;}
#kmyWordApp #kmyTableShadeChip {width:32px;height:6px;margin-top:-5px;border:0;border-radius:0;}
#kmyWordApp .kmy-border-style-sample {display:block;width:30px;border-top:.5pt solid #111;margin:18px 0 14px;}
#kmyWordApp .kmy-border-styles {border-left:1px solid #ddd;padding-left:5px;}
#kmyWordApp .kmy-line-preview {display:block;width:100px;margin:10px;color:#111;}
#kmyWordApp .kmy-table-border-menu {min-width:218px;padding:3px!important;background:#fff!important;border:1px solid #888!important;border-radius:3px!important;box-shadow:2px 5px 10px #0003;}
#kmyWordApp .kmy-table-border-menu button {display:flex!important;align-items:center;justify-content:flex-start!important;gap:10px!important;width:100%;min-height:30px!important;height:30px!important;padding:4px 8px!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;color:#222!important;font:12px "Segoe UI",sans-serif!important;text-align:left;white-space:nowrap;}
#kmyWordApp .kmy-table-border-menu button:hover,#kmyWordApp .kmy-table-border-menu button:focus-visible {background:#e6e6e6!important;outline:1px solid #c6c6c6;outline-offset:-1px;}
#kmyWordApp .kmy-table-border-menu svg {width:22px;height:22px;flex-shrink:0;}
#kmyWordApp .kmy-table-border-menu hr {border:0;border-top:1px solid #d3d3d3;margin:3px 0 3px 32px;}
#kmyWordApp .kmy-borders-button {border:1px solid transparent;}
#kmyWordApp .kmy-borders-button:hover {border-color:#aaa;background:#eee;}
#kmyTableMoveHandle {position:fixed;z-index:100050;display:flex;align-items:center;justify-content:center;width:18px!important;height:18px!important;min-height:0!important;padding:0!important;border:1px solid #999!important;border-radius:0!important;background:#fff!important;color:#555!important;box-shadow:none!important;cursor:var(--kmy-visible-move);}
#kmyTableMoveHandle svg {width:16px;height:16px;pointer-events:none;}
.kmy-table-drop-marker {position:fixed;z-index:100060;border-top:2px solid #185abd;pointer-events:none;}
.kmy-table-draw-outline {position:fixed;z-index:100060;border:1px solid #185abd;background:#185abd10;pointer-events:none;}
#kmyBordersDialog label {display:flex;align-items:center;gap:12px;margin:12px 0;color:#222;font:13px "Segoe UI",sans-serif;}
#kmyBordersDialog .kmy-w365-dialog {padding:20px;min-width:340px;background:white;color:#222;}
#kmyBordersDialog .kmy-dialog-actions {display:flex;justify-content:flex-end;gap:10px;}
@media print {#kmyTableMoveHandle,.kmy-table-drop-marker,.kmy-table-draw-outline {display:none!important;}}
#kmyWordApp #kmyPane_tabledesign svg.kmy-theme-preview {display:block!important;border:0!important;border-radius:0!important;background:none!important;}
#kmyWordApp #kmyPane_tabledesign .kmy-gallery-more {width:22px;min-width:22px;height:64px;border:1px solid #aaa;border-radius:0 4px 4px 0;}
#kmyWordApp #kmyTableStylesMore {width:256px;white-space:normal;}
#kmyWordApp #kmyTableStylesMore .kmy-theme-card {display:inline-flex;}
#kmyWordApp #kmyPane_tabledesign .big-btn {height:88px!important;min-height:88px!important;justify-content:flex-start;padding-top:8px;}
#kmyWordApp #kmyPane_tabledesign .big-btn>svg {flex-shrink:0;}
#kmyWordApp #kmyPane_tabledesign .kmy-borders-button {min-width:60px;border:1px solid #aaa;}
#kmyWordApp #kmyPane_tabledesign .kmy-border-styles .big-btn {min-width:62px;}
#kmyBordersDialog label {text-transform:none!important;letter-spacing:normal!important;}
#kmyBordersDialog input[type="checkbox"] {width:14px;height:14px;min-height:14px;accent-color:#185abd;appearance:auto;}
#kmyBordersDialog .kmy-dialog-actions button {min-width:65px;padding:5px 12px;border:1px solid #aaa;background:#f5f5f5;color:#222;border-radius:2px;font:13px "Segoe UI",sans-serif;}
#kmyBordersDialog .kmy-dialog-actions button:last-child {border-color:#185abd;}

/* Unified desktop ribbon: one scale and menu treatment across every tab. */
#kmyWordApp {--editor-ribbon-font:13px;font-family:"Segoe UI",Arial,sans-serif;}
#kmyWordApp .kmy-w-tab {font-size:14px!important;font-weight:400;padding:7px 13px!important;}
#kmyWordApp .kmy-w-tab.active {font-weight:600;}
#kmyWordApp .kmy-w-tab-context {color:#185abd!important;}
#kmyWordApp .kmy-w-ribbon-pane {min-height:124px!important;padding:6px 8px 3px;align-items:stretch;}
#kmyWordApp .kmy-w-group {padding-inline:10px;min-height:110px;}
#kmyWordApp .kmy-w-group-tools {justify-content:flex-start;padding-top:3px;}
#kmyWordApp .kmy-w-group-title {font-size:12px!important;line-height:17px;bottom:0;font-weight:400!important;}
#kmyWordApp .kmy-btn-tool {font-size:13px!important;font-weight:400;line-height:17px;gap:5px;padding:3px 5px;color:#252525;}
#kmyWordApp .kmy-btn-tool svg {flex-shrink:0;}
#kmyWordApp .kmy-btn-tool.big-btn {height:88px;min-height:88px;min-width:58px;max-width:94px;padding:5px 6px;gap:7px;justify-content:flex-start;text-align:center;}
#kmyWordApp .kmy-btn-tool.big-btn>.kmy-svg-icon {width:30px!important;height:30px!important;margin:0;flex-shrink:0;}
#kmyWordApp .kmy-btn-tool.big-btn>span {white-space:normal;}
#kmyWordApp .kmy-w-ribbon-pane input[type="number"],#kmyWordApp .kmy-w-ribbon-pane select {font-size:13px!important;height:27px!important;max-height:27px!important;}
#kmyWordApp .kmy-popover {font:13px "Segoe UI",sans-serif;color:#222!important;background:#fff!important;border:1px solid #aaa!important;border-radius:3px;box-shadow:2px 4px 10px #0003;}
#kmyWordApp .kmy-popover-item {font:13px "Segoe UI",sans-serif!important;text-align:left;white-space:nowrap;min-height:28px;line-height:19px;padding:5px 10px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;color:#222!important;}
#kmyWordApp button.kmy-popover-item {display:block;width:100%;}
#kmyWordApp .kmy-popover-item:hover {background:#e7e7e7!important;}
#kmyWordApp .kmy-popover-item small {display:block;font-size:11px;padding-top:3px;color:#555;}
#kmyWordApp .kmy-ribbon-menu {min-width:190px;padding:3px;}
#kmyWordApp .kmy-ribbon-stack {display:flex;flex-direction:column;align-items:flex-start;gap:4px;}
#kmyWordApp .kmy-document-style-gallery {display:flex;gap:4px;align-self:flex-start;}
#kmyWordApp .kmy-document-style-card {display:flex;flex-direction:column;justify-content:center;gap:3px;width:94px;height:82px;padding:7px;background:white!important;color:#333!important;border:1px solid #bbb!important;border-radius:0;box-shadow:none;font:12px Calibri,sans-serif;text-align:left;}
#kmyWordApp .kmy-document-style-card strong {font-size:20px;font-weight:400;}
#kmyWordApp .kmy-document-style-card small {font-size:10px;}
#kmyWordApp .kmy-document-style-card:hover {outline:3px solid #d5e3f4;outline-offset:-3px;}
#kmyWordApp .kmy-layout-fields {display:grid;grid-template-columns:155px 150px;gap:5px 14px;font-size:12px;}
#kmyWordApp .kmy-layout-fields label {display:flex;align-items:center;justify-content:space-between;gap:4px;white-space:nowrap;font:12px "Segoe UI",sans-serif;color:#222;text-transform:none;letter-spacing:normal;}
#kmyWordApp .kmy-layout-fields input {width:62px;}
#kmyWordApp .kmy-layout-fields>button {grid-column:1 / -1;justify-self:end;font-size:11px!important;padding:0;}
#kmyWordApp .kmy-view-checks {display:flex;flex-direction:column;gap:10px;padding:5px;}
#kmyWordApp .kmy-view-checks label {font:13px "Segoe UI",sans-serif;color:#222;text-transform:none;letter-spacing:normal;white-space:nowrap;display:flex;gap:6px;align-items:center;}
#kmyWordApp .kmy-view-checks input {width:14px;height:14px;accent-color:#185abd;margin:0;}
#kmyWordApp .kmy-ribbon-stack svg {width:19px;height:19px;}
#kmyWordApp #kmyPane_pictureformat .kmy-w-row>button:not(.big-btn)>svg,#kmyWordApp #kmyPane_shapeformat .kmy-w-row>button>svg {width:20px;height:20px;}
#kmyWordApp #kmyPane_home .kmy-w-row {gap:3px;}
#kmyWordApp #kmyPane_home .kmy-style-card {min-height:66px;}
#kmyWordApp #kmyPane_home .kmy-style-card span {font-size:12px;}
#kmyWordApp #kmyPane_home .kmy-btn-tool:not(.big-btn) .kmy-svg-icon {width:18px;height:18px;}
#kmyWordApp .kmy-read-only .kmy-w-content {cursor:var(--kmy-visible-default);}
#kmyWordApp.kmy-read-only .kmy-floating-shape,#kmyWordApp.kmy-read-only .kmy-wimg-box,#kmyWordApp.kmy-read-only .kmy-floating-box {pointer-events:none;}
.kmy-ribbon-dialog {width:430px;max-width:90vw;padding:20px;background:#fff;color:#222;font:13px "Segoe UI",sans-serif;}
.kmy-ribbon-dialog h3 {font:600 17px "Segoe UI",sans-serif;margin:0 0 18px;}
.kmy-ribbon-dialog label {display:flex;align-items:center;gap:12px;justify-content:space-between;margin:12px 0;color:#222!important;text-transform:none!important;letter-spacing:normal!important;}
.kmy-ribbon-dialog input,.kmy-ribbon-dialog select {width:220px;}
.kmy-ribbon-dialog textarea {height:auto!important;min-height:90px!important;width:270px;}
.kmy-ribbon-dialog footer {display:flex;justify-content:flex-end;gap:8px;margin-top:18px;}
.kmy-ribbon-dialog button {background:#f5f5f5;color:#222;border:1px solid #aaa;border-radius:2px;font:13px "Segoe UI",sans-serif;padding:5px 15px;}
.kmy-ribbon-dialog [data-apply] {border-color:#185abd;}
.kmy-ribbon-error {color:#b00020;}
.kmy-file-actions {display:flex;flex-direction:column;gap:5px;}
.kmy-file-actions button {text-align:left;padding:14px;}
.kmy-document-preview {position:fixed;inset:0;z-index:200100;background:#e4e5e9;overflow:auto;color:#222;}
.kmy-document-preview>header {position:sticky;top:0;z-index:2;background:#fff;padding:12px 20px;display:flex;gap:15px;align-items:center;border-bottom:1px solid #aaa;}
.kmy-document-preview>main {display:flex;flex-direction:column;align-items:center;gap:25px;padding:25px;}
.kmy-document-preview .kmy-w-a4-page {flex-shrink:0;max-width:none;margin:0;box-shadow:0 2px 10px #0002;}
.kmy-document-preview button {font:13px "Segoe UI",sans-serif;background:#fff;color:#222;border:1px solid #999;border-radius:3px;padding:5px 10px;}
#kmyWordApp .kmy-navigation-pane {position:absolute;top:225px;bottom:30px;left:0;width:240px;z-index:120;background:#fafafa;border-right:1px solid #bbb;padding:12px;color:#222;overflow:auto;box-shadow:2px 0 5px #0001;}
#kmyWordApp .kmy-navigation-pane header {display:flex;justify-content:space-between;font-weight:600;}
#kmyWordApp .kmy-navigation-pane button {display:block;background:transparent;border:0;color:#185abd;text-align:left;padding:7px;max-width:100%;font:13px "Segoe UI",sans-serif;}
#kmyWordApp .kmy-navigation-pane p {font:13px "Segoe UI",sans-serif;white-space:pre-wrap;}
#kmyWordApp .kmy-comments-pane {left:auto;right:0;border-left:1px solid #ccc;}
#kmyWordApp .kmy-comments-pane section {padding:8px 0;border-bottom:1px solid #ddd;}
.kmy-comment-anchor {background:#fff3ba;color:inherit;}
@media print {.kmy-document-preview,.kmy-navigation-pane {display:none!important;}.kmy-comment-anchor {background:transparent;}}
#kmyWordApp .kmy-w-ribbon-body {height:136px!important;min-height:136px!important;flex-shrink:0;}
#kmyWordApp #kmyPane_home .kmy-style-card {width:82px;min-width:82px;}
#kmyWordApp #kmyPane_home .kmy-style-card span {font-size:11px;}

/* Compact table ribbons: explicit dimensions avoid inherited CRM button sizing. */
#kmyWordApp #kmyPane_tablelayout .kmy-w-group {padding:0 6px;min-height:100px;}
#kmyWordApp #kmyPane_tablelayout .kmy-word-table-button {min-width:40px;max-width:70px;padding:3px 2px!important;font:12px/15px 'Segoe UI',sans-serif!important;letter-spacing:0;}
#kmyWordApp #kmyPane_tablelayout .kmy-word-table-tools {gap:0;}
#kmyWordApp #kmyPane_tablelayout .kmy-word-cell-size {padding:3px 0;gap:5px;}
#kmyWordApp #kmyPane_tablelayout .kmy-word-cell-size label {width:49px;}
#kmyWordApp #kmyPane_tablelayout .kmy-word-cell-size input {width:58px!important;height:24px!important;}
#kmyWordApp #kmyPane_tablelayout .kmy-word-cell-size .kmy-btn-tool {padding:2px!important;font:12px/15px 'Segoe UI',sans-serif!important;}
#kmyWordApp #kmyPane_tablelayout .kmy-table-align-grid {grid-template-columns:repeat(3,26px);gap:2px;margin-right:4px;}
#kmyWordApp #kmyPane_tablelayout .kmy-table-align-grid button {width:26px;min-width:26px;height:26px;padding:1px!important;}
#kmyWordApp #kmyPane_tablelayout .kmy-table-align-grid svg {width:24px;height:24px;}
#kmyWordApp #kmyPane_tabledesign .kmy-table-gallery {border:1px solid #a5a5a5;border-radius:3px;padding:2px;gap:2px;align-self:flex-start;}
#kmyWordApp #kmyPane_tabledesign .kmy-theme-card {width:70px;min-width:70px;padding:4px;}
#kmyWordApp #kmyPane_tabledesign .kmy-theme-card.active {border:1px solid #777;box-shadow:inset 0 0 0 2px #eee;}
#kmyWordApp #kmyPane_tabledesign .kmy-gallery-more {height:60px;border:0;border-left:1px solid #aaa;}
#kmyTableResizeHandle {position:fixed;z-index:100100;width:15px!important;min-width:15px!important;height:15px!important;min-height:15px!important;padding:0!important;background:white!important;border:1px solid #999!important;border-radius:0!important;cursor:var(--kmy-visible-nwse-resize);}
@media print {#kmyTableResizeHandle {display:none!important;}}

@media (max-width:1450px) {
 #kmyWordApp #kmyPane_tablelayout .kmy-w-group {padding-inline:3px;}
 #kmyWordApp #kmyPane_tablelayout .kmy-w-group:last-child .kmy-word-table-tools {display:flex;flex-direction:column;width:140px;gap:0;}
 #kmyWordApp #kmyPane_tablelayout .kmy-w-group:last-child .kmy-word-table-button {flex-direction:row!important;justify-content:flex-start!important;width:140px;max-width:140px;height:22px!important;min-height:22px!important;max-height:22px!important;gap:4px;}
 #kmyWordApp #kmyPane_tablelayout .kmy-w-group:last-child .kmy-word-table-icon {width:18px;height:18px;}
 #kmyWordApp #kmyPane_tablelayout .kmy-w-group:last-child br {display:none;}
}

#kmyWordApp .kmy-w-ribbon-body:has(#kmyPane_tablelayout.active),#kmyWordApp .kmy-w-ribbon-body:has(#kmyPane_tabledesign.active) {height:120px!important;min-height:120px!important;}
#kmyWordApp #kmyPane_tablelayout,#kmyWordApp #kmyPane_tabledesign {min-height:114px!important;}
#kmyWordApp #kmyPane_tabledesign .kmy-w-group {min-height:100px;}
#kmyWordApp .kmy-table-ruler-boundary {position:absolute;top:1px;width:7px!important;min-width:7px!important;height:15px!important;padding:0!important;border:1px solid #888!important;border-radius:0!important;background:repeating-linear-gradient(0deg,#aaa 0 1px,#eee 1px 3px)!important;z-index:12;cursor:var(--kmy-visible-col-resize);}
@media print {.kmy-table-ruler-boundary {display:none!important;}}
/* Keep every tab at one height so switching context does not move the clicked cell. */
#kmyWordApp .kmy-w-ribbon-body {height:120px!important;min-height:120px!important;}
#kmyWordApp .kmy-w-ribbon-pane {min-height:114px!important;}
#kmyWordApp .kmy-w-group {min-height:100px;}
/* Word-style name previews share the document style rather than a sample alphabet. */
#kmyWordApp #kmyPane_home .kmy-styles-gallery-container {height:62px;border:1px solid #aaa;border-radius:3px;}
#kmyWordApp #kmyStylesViewport {width:312px;max-width:312px;height:60px;}
#kmyWordApp #kmyStylesStrip {gap:0;}
#kmyWordApp #kmyPane_home .kmy-style-card {width:104px!important;min-width:104px!important;max-width:104px!important;height:58px;padding:5px!important;border:1px solid transparent;border-radius:0;background:white;display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;}
#kmyWordApp #kmyPane_home .kmy-style-card.active {border:1px solid #888;box-shadow:inset 0 0 0 3px #e3e3e3;background:white;}
#kmyWordApp #kmyPane_home .kmy-style-card:hover {background:#eee;}
#kmyWordApp #kmyPane_home .kmy-style-card .kmy-style-name {display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0!important;padding:0!important;border:0;line-height:1.3!important;font-size:16px!important;}
#kmyWordApp #kmyPane_home .kmy-style-card[data-word-style="title"] .kmy-style-name {font-size:29px!important;}
#kmyWordApp #kmyPane_home .kmy-style-card[data-word-style="h1"] .kmy-style-name {font-size:23px!important;}
#kmyWordApp #kmyPane_home .kmy-style-card[data-word-style="h2"] .kmy-style-name {font-size:20px!important;}
#kmyWordApp #kmyAllStylesPop {width:530px!important;min-width:0!important;max-width:calc(100vw - 24px);padding:3px!important;border:1px solid #888;border-radius:4px;}
#kmyWordApp #kmyAllStylesPop .kmy-styles-full-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0;}
#kmyWordApp #kmyPane_home #kmyAllStylesPop .kmy-style-card {width:100%!important;min-width:0!important;max-width:none!important;height:64px;}
#kmyWordApp #kmyAllStylesPop .kmy-style-action {display:block;width:100%;text-align:left;border:0;background:white;color:#222;padding:8px 12px;font:13px 'Segoe UI',sans-serif;}
#kmyWordApp #kmyAllStylesPop .kmy-style-action:hover {background:#eee;}
#kmyWordApp .kmy-styles-nav {height:60px;}

#kmyWordApp #kmyPane_home .kmy-style-card.active {background:white!important;border-color:#888!important;box-shadow:inset 0 0 0 3px #e3e3e3!important;}
#kmyWordApp #kmyPane_home .kmy-style-card:hover {background:#eee!important;}
#kmyPageSetupModal {background:transparent!important;backdrop-filter:none!important;align-items:center;justify-content:center;}
#kmyPageSetupModal .kmy-setup-dialog {width:500px;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);overflow:auto;background:#fafafa;color:#111;border:1px solid #aaa;border-radius:7px;box-shadow:0 14px 30px #0004;font:13px 'Segoe UI',sans-serif;}
#kmyPageSetupModal header {display:flex;justify-content:space-between;align-items:center;padding:9px 12px;}
#kmyPageSetupModal button {font:13px 'Segoe UI',sans-serif;color:#111;background:#fafafa;border:1px solid #ccc;border-radius:2px;padding:5px 15px;min-height:0;}
#kmyPageSetupModal header button {border:0;padding:0 5px;font-size:21px;}
#kmyPageSetupModal nav {display:flex;padding:0 10px;gap:1px;}
#kmyPageSetupModal nav button {padding:4px 18px;}
#kmyPageSetupModal nav button.active {background:white;border-bottom-color:white;}
#kmyPageSetupModal main {margin:0 9px;padding:10px;border:1px solid #ddd;background:#fafafa;}
#kmyPageSetupModal fieldset {border:0;border-top:1px solid #ddd;padding:10px 0;margin:0 0 10px;}
#kmyPageSetupModal legend {padding-right:10px;color:#111;font-size:13px;}
#kmyPageSetupModal .kmy-setup-grid {display:grid;grid-template-columns:1fr 1fr;gap:8px 20px;}
#kmyPageSetupModal label {display:flex;align-items:center;justify-content:space-between;gap:8px;color:#111;text-transform:none;letter-spacing:normal;font:13px 'Segoe UI',sans-serif;}
#kmyPageSetupModal input[type=number] {width:76px!important;min-height:0!important;height:25px!important;padding:2px 5px!important;color:#111!important;background:white!important;border:1px solid #aaa!important;border-radius:0!important;font:13px 'Segoe UI',sans-serif;}
#kmyPageSetupModal select {width:auto;max-width:210px;height:27px!important;min-height:0!important;padding:2px 8px!important;color:#111!important;background:white!important;border:1px solid #aaa!important;font:13px 'Segoe UI',sans-serif;}
#kmyPageSetupModal .kmy-orientation-choices {display:flex;gap:16px;}
#kmyPageSetupModal .kmy-orientation-choices label {display:flex;flex-direction:column;position:relative;gap:4px;cursor:pointer;}
#kmyPageSetupModal .kmy-orientation-choices input {position:absolute;opacity:0;width:1px;height:1px;}
#kmyPageSetupModal .kmy-orient-icon {width:65px;height:56px;border:1px solid #888;display:grid;place-items:center;background:white;}
#kmyPageSetupModal .kmy-orient-icon svg {width:42px;height:42px;}
#kmyPageSetupModal .landscape svg {transform:rotate(90deg);}
#kmyPageSetupModal input:checked+.kmy-orient-icon {outline:1px solid #0078d4;outline-offset:2px;border-color:#0078d4;}
#kmyPageSetupModal input:focus-visible+.kmy-orient-icon {outline:2px solid #0078d4;}
#kmyPageSetupModal .kmy-preview-field {margin-top:24px;}
#kmyPagePreview {display:flex;gap:6px;justify-content:flex-start;padding:4px 70px 10px;min-height:124px;}
#kmyPagePreview .kmy-mini-page {position:relative;background:white;border:1px solid #111;box-shadow:1px 2px 4px #0004;flex-shrink:0;}
#kmyPagePreview .kmy-mini-lines {background:repeating-linear-gradient(to bottom,#555 0 1px,transparent 1px 4px);}
#kmyPageSetupModal .kmy-setup-scope {justify-content:flex-start;margin-top:8px;}
#kmyPageSetupModal footer {padding:10px;display:flex;gap:8px;}
#kmyPageSetupModal footer span {flex:1;}
#kmyPageSetupError {color:#a00;font:12px 'Segoe UI',sans-serif;margin:5px 0;}
#kmyPageSetupModal [hidden] {display:none!important;}
.kmy-page-setup-applied>.kmy-w-header {position:absolute;top:var(--kmy-header-distance);left:inherit;right:inherit;left:var(--kmy-page-left,1.5cm);right:var(--kmy-page-right,1.5cm);margin:0;min-height:0;}
.kmy-page-setup-applied>.kmy-w-footer {position:absolute;bottom:var(--kmy-footer-distance);left:var(--kmy-page-left,1.5cm);right:var(--kmy-page-right,1.5cm);margin:0;min-height:0;}
.kmy-page-setup-applied>.kmy-w-content {min-height:0;flex:1;}

#kmyPageSetupModal fieldset {padding:7px 0;margin-bottom:7px;}
#kmyPageSetupModal .kmy-preview-field {margin-top:14px;}
#kmyPageSetupModal button,#kmyPageSetupModal label {margin-bottom:0;}
#kmyPageSetupModal select {border-radius:0!important;}
#kmyPagePreview {min-height:118px;}
/* Paragraph and Tabs: compact desktop dialogs, isolated from CRM theme. */
#kmyParagraphDialogModal,#kmyTabsDialogModal {background:transparent;backdrop-filter:none;animation:none;color-scheme:light;}
#kmyTabsDialogModal {z-index:100070;}
#kmyParagraphDialogModal .kmy-w365-dialog,#kmyTabsDialogModal .kmy-w365-dialog {background:#f0f0f0!important;font:12px 'Segoe UI',sans-serif;animation:kmyWordDialogEnter 120ms ease-out;}
#kmyParagraphDialogModal .kmy-w365-dialog {width:580px!important;}
#kmyTabsDialogModal .kmy-w365-dialog {width:400px!important;}
#kmyParagraphDialogModal .kmy-w365-titlebar,#kmyTabsDialogModal .kmy-w365-titlebar {background:#f3f3f9;border:0;height:36px;flex-shrink:0;padding-left:10px;}
#kmyParagraphDialogModal .kmy-w365-title,#kmyTabsDialogModal .kmy-w365-title {font-size:14px;font-weight:400;}
#kmyParagraphDialogModal .kmy-w365-body {background:#f8f8f8;margin:0 9px;border:1px solid #ddd;padding:14px 12px!important;}
#kmyTabsDialogModal .kmy-w365-body {background:#f0f0f0;padding:10px;}
#kmyParagraphDialogModal .kmy-w365-tabs {background:#f0f0f0;border:0;padding-left:9px;}
#kmyParagraphDialogModal .kmy-w365-tab {border-radius:0!important;font-weight:400!important;padding:5px 12px!important;}
#kmyParagraphDialogModal .kmy-w365-check,#kmyTabsDialogModal .kmy-w365-check {font-weight:400!important;font-size:12px!important;}
#kmyParagraphDialogModal input[type=radio],#kmyTabsDialogModal input[type=radio] {-webkit-appearance:radio!important;appearance:auto!important;border-radius:50%!important;}
#kmyParagraphDialogModal .kmy-w365-section-title,#kmyTabsDialogModal .kmy-w365-section-title {color:#111;font-weight:400;margin-bottom:10px;}
#kmyParagraphDialogModal .kmy-w365-foot,#kmyTabsDialogModal .kmy-w365-foot {background:#f0f0f0;border:0;padding:12px 9px;flex-shrink:0;}
#kmyParagraphDialogModal .kmy-w365-btn,#kmyTabsDialogModal .kmy-w365-btn {background:#fdfdfd!important;color:#111!important;border:1px solid #c8c8c8!important;box-shadow:none!important;min-width:110px;height:29px;border-radius:3px!important;font-weight:400!important;transition:background-color 100ms,border-color 100ms;}
#kmyParagraphDialogModal .kmy-w365-btn.primary,#kmyTabsDialogModal .kmy-w365-btn.primary {border-color:#0078d4!important;}
#kmyParagraphDialogModal .kmy-w365-btn:hover,#kmyTabsDialogModal .kmy-w365-btn:hover {background:#e5f1fb!important;border-color:#0078d4!important;}
#kmyParagraphDialogModal button:disabled,#kmyTabsDialogModal button:disabled {opacity:.5;cursor:var(--kmy-visible-default)!important;}
#kmyParagraphDialogModal .kmy-para-general {grid-template-columns:260px 1fr!important;gap:7px 16px!important;}
#kmyParagraphDialogModal .kmy-para-general>.kmy-w365-row {grid-column:1;}
#kmyParagraphDialogModal .kmy-para-general>.kmy-w365-check {grid-column:2;grid-row:2;}
#kmyParagraphDialogModal .kmy-para-general select {width:160px;flex:none;}
#kmyParagraphDialogModal .kmy-para-direction>div {gap:18px!important;}
#kmyParagraphDialogModal .kmy-para-pair {grid-template-columns:260px 1fr!important;}
#kmyParagraphDialogModal .kmy-para-pair>div:first-child .kmy-w365-row {justify-content:flex-start;}
#kmyParagraphDialogModal .kmy-para-pair>div:first-child .kmy-w365-label {width:94px;}
#kmyParagraphDialogModal .kmy-para-special {display:grid!important;grid-template-columns:1fr 82px;gap:14px!important;}
#kmyParagraphDialogModal .kmy-para-special .kmy-w365-row {display:flex;flex-direction:column;align-items:stretch;gap:7px;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap {width:82px;box-sizing:border-box;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap input {width:100%;min-width:0;}
#kmyParagraphDialogModal .kmy-w365-prev-active {outline:0;border:0;background:transparent;font-size:9px;}
#kmyParagraphDialogModal .kmy-w365-preview-box {height:112px;padding:9px 30px;overflow:hidden;}
#kmyParagraphDialogModal .kmy-w365-prev-dummy {font-size:8px;}
#kmyTabsDialogModal .kmy-tabs-top {display:grid;grid-template-columns:224px 1fr;gap:14px;margin-bottom:8px;}
#kmyTabsDialogModal .kmy-tabs-top label {display:block;font-weight:400;margin-bottom:4px;font-size:12px;color:#111!important;text-transform:none!important;letter-spacing:normal!important;}
#kmyTabsDialogModal #kmyTabStopPos {width:100%;}
#kmyTabsDialogModal #kmyTabStopList {width:100%;height:106px!important;border-radius:0!important;}
#kmyTabsDialogModal .kmy-w365-spin-wrap {width:100%;box-sizing:border-box;}
#kmyTabsDialogModal #kmyDefaultTabStop {width:100%;min-width:0;}
#kmyTabsDialogModal .kmy-tabs-top p {font-size:12px;margin:14px 0 5px;}
#kmyTabsDialogModal #kmyTabsCleared {max-height:66px;overflow:auto;font-size:12px;}
#kmyTabsDialogModal .kmy-tabs-radios {display:grid;grid-template-columns:repeat(3,1fr);gap:10px 4px;margin:0 10px 15px;}
#kmyTabsDialogModal .kmy-tabs-actions {display:flex;justify-content:space-between;margin:0 12px;gap:10px;}
#kmyTabsDialogModal .kmy-w365-foot {justify-content:flex-end;gap:15px;padding:5px 10px 10px;}
.kmy-tab-stop-marker.bar::after {content:"";position:absolute;left:5px;top:1px;height:11px;border-left:2px solid #333;}
@keyframes kmyWordDialogEnter {from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#kmyParagraphDialogModal .kmy-w365-dialog,#kmyTabsDialogModal .kmy-w365-dialog {animation:none;}}
/* Reference dimensions are CSS pixels; browser accessibility zoom is respected. */
#kmyParagraphDialogModal .kmy-w365-dialog {width:584px!important;height:704px;max-height:calc(100vh - 20px);}
#kmyParagraphDialogModal .kmy-w365-titlebar {height:37px;}
#kmyParagraphDialogModal .kmy-w365-tabs {height:36px;flex-shrink:0;align-items:flex-end;}
#kmyParagraphDialogModal .kmy-w365-tab {height:27px!important;box-sizing:border-box;font-size:12px!important;}
#kmyParagraphDialogModal .kmy-w365-body {flex:1;min-height:0;padding:14px 12px!important;border-bottom:0;}
#kmyParagraphDialogModal .kmy-para-general {grid-template-columns:263px 1fr!important;margin-bottom:9px!important;gap:5px 14px!important;}
#kmyParagraphDialogModal .kmy-para-general .kmy-w365-row {justify-content:flex-start;gap:0;}
#kmyParagraphDialogModal .kmy-para-general .kmy-w365-label {width:102px;padding-left:14px;box-sizing:border-box;}
#kmyParagraphDialogModal .kmy-para-direction {margin:0 0 8px!important;padding-left:14px;}
#kmyParagraphDialogModal .kmy-para-direction>div {display:grid!important;grid-template-columns:74px 161px 1fr;gap:14px!important;}
#kmyParagraphDialogModal .kmy-para-pair {padding-left:14px;grid-template-columns:249px 1fr!important;gap:14px!important;}
#kmyParagraphDialogModal .kmy-para-pair>div:first-child .kmy-w365-label {width:80px;}
#kmyParagraphDialogModal .kmy-para-special {grid-template-columns:160px 84px;gap:14px!important;}
#kmyParagraphDialogModal .kmy-para-pair+div {padding-left:14px;margin-bottom:32px!important;}
#kmyParagraphDialogModal #kmyParaTabPane_1>div:last-child {margin-bottom:0!important;}
#kmyParagraphDialogModal .kmy-para-pair .kmy-w365-row {min-height:26px;}
#kmyParagraphDialogModal .kmy-para-pair .kmy-para-special .kmy-w365-row {gap:8px;}
#kmyParagraphDialogModal .kmy-paragraph-preview {background:#f8f8f8;margin:0 9px;padding:0 12px 16px;border:1px solid #ddd;border-top:0;flex-shrink:0;}
#kmyParagraphDialogModal .kmy-w365-preview-box {margin-left:14px;box-sizing:border-box;height:114px;padding:9px 31px;}
#kmyParagraphDialogModal .kmy-w365-foot {display:grid;grid-template-columns:1fr 1fr;padding:12px 9px 10px;gap:50px;}
#kmyParagraphDialogModal .kmy-w365-foot>div {display:flex;justify-content:space-between;gap:16px!important;}
#kmyParagraphDialogModal .kmy-w365-btn,#kmyTabsDialogModal .kmy-w365-btn {width:112px!important;min-width:112px!important;padding:0!important;height:29px!important;}
#kmyParagraphDialogModal .kmy-w365-foot>div:first-child {gap:50px!important;}
#kmyParagraphDialogModal #kmyParaTabPane_2>div:nth-child(2),#kmyParagraphDialogModal .kmy-pagination-options {display:flex;flex-direction:column;gap:9px!important;margin:0 14px 14px;}
#kmyParagraphDialogModal .kmy-tight-wrap {display:block;margin:0 14px;font-size:12px;font-weight:400;color:#111;text-transform:none;}
#kmyParagraphDialogModal .kmy-tight-wrap select {display:block;width:224px;margin-top:5px;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap,#kmyTabsDialogModal .kmy-w365-spin-wrap {position:relative;height:26px;overflow:hidden;border-radius:0;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap input,#kmyTabsDialogModal .kmy-w365-spin-wrap input {border:0!important;padding:2px 3px!important;height:24px!important;text-align:left!important;appearance:textfield!important;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap {width:84px;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap input {width:calc(100% - 35px)!important;}
#kmyTabsDialogModal .kmy-w365-spin-wrap input {width:calc(100% - 35px)!important;}
#kmyParagraphDialogModal .kmy-w365-spin-unit,#kmyTabsDialogModal .kmy-w365-spin-wrap>span:not(.kmy-stepper) {border:0!important;padding:0!important;font:12px 'Segoe UI';}
#kmyParagraphDialogModal input::-webkit-inner-spin-button,#kmyTabsDialogModal input::-webkit-inner-spin-button {appearance:none!important;}
#kmyParagraphDialogModal .kmy-stepper,#kmyTabsDialogModal .kmy-stepper {position:absolute;right:1px;top:1px;bottom:1px;width:17px;display:flex;flex-direction:column;}
#kmyParagraphDialogModal .kmy-stepper button,#kmyTabsDialogModal .kmy-stepper button {display:block;width:17px!important;min-width:0!important;height:11px!important;min-height:0!important;line-height:8px!important;font:10px 'Segoe UI'!important;padding:0!important;border:1px solid #aaa!important;border-radius:0!important;background:#eee!important;color:#333!important;box-shadow:none!important;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap:has(input:disabled) {background:#eee;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap:has(input:disabled) .kmy-stepper {opacity:.4;pointer-events:none;}
#kmyTabsDialogModal .kmy-w365-dialog {height:454px;}
#kmyTabsDialogModal .kmy-w365-body {flex:1;padding:10px 9px 0;}
#kmyTabsDialogModal .kmy-tabs-actions {margin:0 13px;gap:15px;}
#kmyTabsDialogModal .kmy-w365-foot {padding:10px;}
#kmyParagraphDialogModal .kmy-w365-dialog,#kmyTabsDialogModal .kmy-w365-dialog {animation:kmyWordDialogFade 100ms ease-out;}
@keyframes kmyWordDialogFade {from{opacity:0}to{opacity:1}}
/* Keep all paragraph fields visible on shorter browser viewports. */
@media (max-height:760px) {
  #kmyParagraphDialogModal .kmy-w365-body {padding-top:8px!important;padding-bottom:8px!important;}
  #kmyParagraphDialogModal .kmy-para-pair+div {margin-bottom:14px!important;}
  #kmyParagraphDialogModal .kmy-paragraph-preview {padding-bottom:10px;}
  #kmyParagraphDialogModal .kmy-w365-foot {padding-top:8px;padding-bottom:8px;}
}
#kmyParagraphDialogModal .kmy-w365-tab:focus-visible,#kmyTabsDialogModal button:focus-visible {outline:1px dotted #333!important;outline-offset:-4px;}
@media(prefers-reduced-motion:reduce){#kmyParagraphDialogModal .kmy-w365-dialog,#kmyTabsDialogModal .kmy-w365-dialog{animation:none;}}

/* Nonprinting glyphs are a view overlay, never document characters. */
.kmy-formatting-marks {position:fixed;inset:0;pointer-events:none;z-index:12;overflow:hidden;user-select:none;}
.kmy-formatting-marks[hidden] {display:none!important;}
.kmy-formatting-marks span {position:absolute;color:#333;font-family:Calibri,Arial,sans-serif;font-weight:400;white-space:pre;}
@media print {.kmy-formatting-marks {display:none!important;}}

/* Compact Layout controls share the document paragraph settings. */
#kmyPane_layout .kmy-w-group:has(.kmy-layout-fields) {position:relative;padding-left:18px;padding-right:18px;}
#kmyWordApp .kmy-layout-fields {grid-template-columns:138px 140px;gap:6px 16px;align-items:center;}
#kmyWordApp .kmy-layout-fields input {width:70px!important;height:25px!important;min-height:25px!important;padding:2px 4px!important;border:1px solid #aaa!important;border-radius:2px!important;font:12px 'Segoe UI'!important;}
#kmyWordApp .kmy-layout-fields input::-webkit-inner-spin-button {opacity:1;}
#kmyWordApp .kmy-layout-fields>.kmy-layout-launcher {position:absolute;bottom:2px;right:3px;width:16px;height:16px;min-height:0;font-size:13px!important;}
#kmyPane_layout .big-btn {min-width:58px!important;padding-left:5px!important;padding-right:5px!important;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap input {flex:none!important;}
#kmyParagraphDialogModal .kmy-w365-spin-unit {margin-right:auto;}

/* Border feedback overrides the editor's text cursor without editing document HTML. */
body.kmy-table-col-hover, body.kmy-table-col-hover * { cursor:var(--kmy-visible-col-resize) !important; }
body.kmy-table-row-hover, body.kmy-table-row-hover * { cursor:var(--kmy-visible-row-resize) !important; }
.kmy-table-resize-guide { position:fixed; pointer-events:none; z-index:2147483647; }
#kmyWordApp .kmy-btn-tool, #kmyWordApp .kmy-popover-item {
  transition: background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 100ms ease-out;
  cursor:var(--kmy-visible-default);
}
#kmyWordApp .kmy-btn-tool:hover:not(:disabled) {background-color:#e5eefb;box-shadow:inset 0 0 0 1px #b7cce9;}
#kmyWordApp .kmy-btn-tool:active:not(:disabled), #kmyWordApp .kmy-popover-item:active {background-color:#c9ddf8!important;}
#kmyWordApp .kmy-btn-tool:focus-visible {outline:1px solid #185abd;outline-offset:-2px;}
#kmyWordApp .kmy-theme-card {height:auto!important;min-height:60px;padding:5px!important;align-items:center;justify-content:center;}
#kmyWordApp .kmy-theme-card .kmy-theme-preview {pointer-events:none;}
#kmyWordApp .kmy-popover.show {animation:kmy-menu-appear 100ms ease-out;transform-origin:top left;}
@keyframes kmy-menu-appear {from{opacity:0;transform:translateY(-2px);}to{opacity:1;transform:translateY(0);}}
#kmyWordApp button:disabled {cursor:var(--kmy-visible-default);}
@media(prefers-reduced-motion:reduce){#kmyWordApp .kmy-popover.show{animation:none;}#kmyWordApp .kmy-btn-tool,#kmyWordApp .kmy-popover-item{transition:none;}}

/* Native desktop cursors: controls use an arrow, editable text an I-beam. */
#kmyWordApp {cursor:var(--kmy-visible-default);}
#kmyWordApp :is(button,select,label,input[type=checkbox],input[type=radio],input[type=range],.kmy-popover-item,.kmy-w-tab),
#kmyWordApp :is(button,label,.kmy-popover-item,.kmy-w-tab) * {cursor:var(--kmy-visible-default)!important;}
#kmyWordApp :is(input:not([type]),input[type=text],input[type=number],input[type=search],textarea) {cursor:var(--kmy-visible-text)!important;}
#kmyWordApp :is(.kmy-wimg-box,.kmy-floating-shape,.kmy-floating-box,.kmy-shape-grabbar) {cursor:var(--kmy-visible-move)!important;}
#kmyWordApp :is(.kmy-wimg-box img,.kmy-floating-shape>svg) {cursor:inherit!important;}
#kmyWordApp :is(.kmy-h-nw,.kmy-h-se,.kmy-shape-handle.nw,.kmy-shape-handle.se,.kmy-crop-nw,.kmy-crop-se) {cursor:var(--kmy-visible-nwse-resize)!important;}
#kmyWordApp :is(.kmy-h-ne,.kmy-h-sw,.kmy-shape-handle.ne,.kmy-shape-handle.sw,.kmy-crop-ne,.kmy-crop-sw) {cursor:var(--kmy-visible-nesw-resize)!important;}
#kmyWordApp :is(.kmy-h-n,.kmy-h-s,.kmy-shape-handle.n,.kmy-shape-handle.s,.kmy-crop-n,.kmy-crop-s) {cursor:var(--kmy-visible-ns-resize)!important;}
#kmyWordApp :is(.kmy-h-e,.kmy-h-w,.kmy-shape-handle.e,.kmy-shape-handle.w,.kmy-crop-e,.kmy-crop-w) {cursor:var(--kmy-visible-ew-resize)!important;}
#kmyWordApp :is(.kmy-h-rotate,.kmy-shape-handle.rot) {cursor:grab!important;}

#kmyTableMoveHandle,#kmyTableMoveHandle * {cursor:var(--kmy-visible-move)!important;}
#kmyTableResizeHandle,#kmyTableResizeHandle * {cursor:var(--kmy-visible-nwse-resize)!important;}
body.kmy-table-col-hover #kmyWordApp *,body.kmy-table-col-hover * {cursor:var(--kmy-visible-col-resize)!important;}
body.kmy-table-row-hover #kmyWordApp *,body.kmy-table-row-hover * {cursor:var(--kmy-visible-row-resize)!important;}

/* Object content must not inherit the document-wide I-beam. */
#kmyWordApp .kmy-floating-shape:not(.kmy-editing) :is(.kmy-shape-text,.kmy-shape-text *) {cursor:var(--kmy-visible-move)!important;}
#kmyWordApp .kmy-floating-shape.kmy-editing :is(.kmy-shape-text,.kmy-shape-text *) {cursor:var(--kmy-visible-text)!important;}
#kmyWordApp .kmy-shape-grabframe,#kmyWordApp .kmy-shape-grabbar {cursor:var(--kmy-visible-move)!important;}
#kmyWordApp .kmy-shape-handle.round {cursor:var(--kmy-visible-ew-resize)!important;}
#kmyWordApp .kmy-floating-box [contenteditable=true],#kmyWordApp .kmy-floating-box [contenteditable=true] * {cursor:var(--kmy-visible-text)!important;}
#kmyWordApp .kmy-drawing-shape,#kmyWordApp .kmy-drawing-shape * {cursor:var(--kmy-visible-crosshair)!important;}
body.kmy-object-pointer,body.kmy-object-pointer #kmyWordApp *,body.kmy-object-pointer * {cursor:var(--kmy-object-cursor)!important;}
body.kmy-object-pointer #kmyWordApp#kmyWordApp * {cursor:var(--kmy-object-cursor)!important;}

/* Document tables scroll with the page, never with CRM data-grid headers. */
#kmyWordCanvas :is(thead,tbody,tfoot,tr,th,td) {position:static!important;top:auto!important;bottom:auto!important;z-index:auto!important;}

:root {--kmy-visible-default: default;--kmy-visible-text: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2220%22%20viewBox%3D%220%200%2016%2020%22%3E%3Cpath%20d%3D%22M5%202.5h2l1%201%201-1h2M8%203.5v13M5%2017.5h2l1-1%201%201h2%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221%22%20shape-rendering%3D%22crispEdges%22%2F%3E%3C%2Fsvg%3E") 8 10, text;--kmy-visible-move: move;--kmy-visible-ew-resize: ew-resize;--kmy-visible-ns-resize: ns-resize;--kmy-visible-nwse-resize: nwse-resize;--kmy-visible-nesw-resize: nesw-resize;--kmy-visible-crosshair: crosshair;--kmy-visible-col-resize: col-resize;--kmy-visible-row-resize: row-resize;}
#kmyWordApp {--kmy-cursor-pointer:var(--kmy-visible-default);--kmy-cursor-ibeam:var(--kmy-visible-text);}

/* Paper has a fixed box; document flow creates continuation pages. */
#kmyWordCanvas .kmy-w-a4-page {flex-shrink:0;}
#kmyWordCanvas .kmy-w-a4-page > .kmy-w-content {min-height:0!important;flex:1 1 0;display:flow-root;}
#kmyWordCanvas .kmy-w-a4-page > .kmy-w-header,
#kmyWordCanvas .kmy-w-a4-page > .kmy-w-footer {flex-shrink:0;}


/* Compact Insert ribbon: large primary tools with stacked secondary commands. */
#kmyWordApp #kmyPane_insert {gap:0;font-family:"Segoe UI",Arial,sans-serif;}
#kmyWordApp #kmyPane_insert > .kmy-w-group {padding:0 9px;animation:none;}
#kmyWordApp #kmyPane_insert .kmy-w-group-tools {justify-content:flex-start;padding-top:2px;gap:0;}
#kmyWordApp #kmyPane_insert .kmy-w-group-title {font-size:10px;font-weight:400;color:#323130;}
#kmyWordApp #kmyPane_insert .big-btn {font-size:11px!important;font-weight:400!important;min-width:48px!important;height:68px!important;padding:4px 6px!important;gap:5px!important;border-radius:2px!important;}
#kmyWordApp #kmyPane_insert .big-btn > .kmy-svg-icon {width:28px!important;height:28px!important;stroke-width:1.25;}
#kmyWordApp #kmyPane_insert .big-btn span .kmy-svg-icon {width:10px!important;height:10px!important;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(1),:nth-child(4),:nth-child(5),:nth-child(7)) .kmy-w-row {flex-direction:column;align-items:stretch!important;justify-content:flex-start;height:auto!important;gap:0;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(1),:nth-child(4),:nth-child(5),:nth-child(7)) .big-btn,
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(3),:nth-child(6)) .kmy-w-dropdown > .big-btn,
#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(6) button[onclick*="Signature"] {
 flex-direction:row!important;justify-content:flex-start!important;height:23px!important;min-height:23px!important;min-width:0!important;width:100%;padding:2px 4px!important;gap:6px!important;white-space:nowrap;
}
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(1),:nth-child(4),:nth-child(5),:nth-child(7)) .big-btn > .kmy-svg-icon,
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(3),:nth-child(6)) .kmy-w-dropdown > .big-btn > .kmy-svg-icon,
#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(6) button[onclick*="Signature"] > .kmy-svg-icon {width:16px!important;height:16px!important;flex-shrink:0;stroke-width:1.3;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(3),:nth-child(6)) .kmy-w-row {display:grid;grid-template-columns:auto auto;grid-template-rows:23px 23px 23px;align-items:start!important;height:auto!important;gap:0 3px;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(3),:nth-child(6)) .kmy-w-row > button:first-child {grid-column:1;grid-row:1 / 4;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:is(:nth-child(3),:nth-child(6)) .kmy-w-row > .kmy-w-dropdown {grid-column:2;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(6) button[onclick*="Signature"] {grid-column:2;grid-row:2;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(7) .kmy-w-dropdown {order:2;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(7) button[onclick*="Equation"] {order:1;}
#kmyWordApp #kmyPane_insert .big-btn:hover {background:#e5eefb!important;box-shadow:inset 0 0 0 1px #b7cce9;}

#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(5) {min-width:126px;}
#kmyWordApp #kmyPane_insert > .kmy-w-group:nth-child(5) .big-btn br {display:none;}


/* Consistent desktop interaction feedback; geometry stays stable under the pointer. */
#kmyWordApp {
 --kmy-ui-hover:#edf3fa;--kmy-ui-pressed:#d6e5f5;--kmy-ui-selected:#e1ecf8;
 --kmy-ui-border:#b8cce3;--kmy-ui-focus:#185abd;
}
#kmyWordApp :is(.kmy-btn-tool,.kmy-w-tab,.kmy-w-head-btn,.kmy-popover-item,.kmy-style-card,.kmy-style-nav-btn,.kmy-shape-btn,.kmy-bullet-tile,.kmy-theme-card,.kmy-document-style-card,.kmy-color-chip,.kmy-color-swatch,.kmy-sym-btn,.kmy-lo-item,.kmy-layout-btn,.kmy-ctx-item,.kmy-ctx-mini button,.kmy-w365-btn,.kmy-w365-tab,.kmy-w-select-btn) {
 transition:background-color 110ms ease-out,border-color 110ms ease-out,box-shadow 110ms ease-out,color 110ms ease-out!important;
}
#kmyWordApp :is(.kmy-btn-tool,.kmy-popover-item,.kmy-style-card,.kmy-shape-btn,.kmy-bullet-tile,.kmy-theme-card,.kmy-document-style-card,.kmy-sym-btn,.kmy-lo-item,.kmy-ctx-item):hover:not(:disabled):not([aria-disabled=true]) {
 background-color:var(--kmy-ui-hover)!important;
 box-shadow:inset 0 0 0 1px var(--kmy-ui-border)!important;
}
#kmyWordApp :is(.kmy-btn-tool,.kmy-popover-item,.kmy-style-card,.kmy-shape-btn,.kmy-bullet-tile,.kmy-theme-card,.kmy-document-style-card,.kmy-sym-btn,.kmy-lo-item,.kmy-ctx-item,.kmy-ctx-mini button):active:not(:disabled):not([aria-disabled=true]) {
 background-color:var(--kmy-ui-pressed)!important;box-shadow:inset 0 0 0 1px #91b2d6!important;transition-duration:0ms!important;
}
#kmyWordApp :is(.kmy-btn-tool,.kmy-style-card):is(.active,[aria-checked=true],[aria-pressed=true]) {background-color:var(--kmy-ui-selected)!important;box-shadow:inset 0 0 0 1px #9cbadb!important;}
#kmyWordApp :is(.kmy-btn-tool,.kmy-style-card):is(.active,[aria-checked=true],[aria-pressed=true]):hover {background-color:#d4e4f5!important;}
#kmyWordApp :is(.kmy-style-card,.kmy-shape-btn,.kmy-bullet-tile,.kmy-theme-card,.kmy-document-style-card,.kmy-color-chip,.kmy-color-swatch,.kmy-ctx-mini button):is(:hover,:active) {transform:none!important;}
#kmyWordApp :is(button,[role=button],input,select,textarea):focus-visible {outline:2px solid var(--kmy-ui-focus)!important;outline-offset:1px;}
#kmyWordApp :is(button,[role=button]):is(:disabled,[aria-disabled=true]) {animation:none!important;transition:none!important;box-shadow:none!important;cursor:default!important;}
#kmyWordApp .kmy-w-tab:not(.file-tab):hover {background-color:#eef0f3!important;}
#kmyWordApp .kmy-w-tab:not(.file-tab):active {background-color:#e0e7f0!important;}
#kmyWordApp .kmy-w-tab.active::after {animation:none!important;}
#kmyWordApp .kmy-w-ribbon-pane.active > .kmy-w-group {animation:none!important;}
#kmyWordApp .kmy-popover.show {animation:kmySurfaceFade 110ms ease-out!important;border-color:#d1d5db;box-shadow:0 5px 16px #00000024,0 1px 3px #00000012!important;}
#kmyWordApp :is(.kmy-w365-dialog,.kmy-styles-drawer) {animation:kmySurfaceFade 130ms ease-out!important;}
#kmyWordApp :is(.kmy-wimg-float,.kmy-wtable-float,.kmy-layout-btn) {transition:opacity 100ms ease-out,background-color 100ms ease-out,border-color 100ms ease-out!important;}
@keyframes kmySurfaceFade {from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){
 #kmyWordApp *,#kmyWordApp *::before,#kmyWordApp *::after {animation:none!important;transition:none!important;}
}


#kmyColsPop {min-width:180px;}
#kmyColsPop .kmy-column-preset {display:flex;align-items:center;gap:18px;min-height:52px;padding:6px 12px;}
.kmy-columns-dialog .kmy-ribbon-dialog {width:480px;max-width:95vw;}
.kmy-columns-presets {display:flex;justify-content:space-between;gap:8px;}
.kmy-columns-presets button {display:flex;flex-direction:column;align-items:center;gap:4px;background:white;border:1px solid #c8c8c8;padding:6px 12px;}
.kmy-columns-presets button:hover {background:#e5eefb;border-color:#185abd;}
.kmy-columns-options {display:flex;justify-content:space-between;align-items:center;margin:14px 0;}
.kmy-columns-dialog input[type=number] {width:68px;}
#kmyColumnRows {display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;max-height:170px;overflow:auto;margin-bottom:10px;}
#kmyColumnRows label {display:flex;align-items:center;justify-content:space-between;}
#kmyColumnPreview {display:flex;width:150px;height:115px;background:white;border:1px solid #aaa;padding:10px;margin:12px auto;}
#kmyColumnPreview i {display:block;height:2px;background:#999;margin:5px 0;}
.kmy-flow-column.kmy-column-rule::before {content:"";position:absolute;top:0;bottom:0;left:var(--kmy-column-rule-offset);border-left:1px solid #666;pointer-events:none;}
.kmy-columns-dialog small {display:block;margin-top:8px;color:#666;}

.kmy-columns-dialog label {font-weight:400!important;}
.kmy-columns-dialog label:has(input[type=checkbox]) {display:flex!important;flex-direction:row!important;justify-content:flex-start!important;gap:7px;align-items:center;}
.kmy-columns-dialog input[type=checkbox] {appearance:auto!important;width:14px!important;height:14px!important;flex:none;}

#kmyBreaksMenu {width:340px;max-height:calc(100vh - 190px);overflow-y:auto;padding:0;}
#kmyBreaksMenu .kmy-break-menu-heading {font:600 12px "Segoe UI",sans-serif;padding:9px 14px;border-top:1px solid #ddd;}
#kmyBreaksMenu .kmy-break-menu-heading:first-child {border-top:0;}
#kmyBreaksMenu .kmy-break-menu-item {display:flex;align-items:center;gap:16px;padding:9px 18px;white-space:normal;text-align:left;width:100%;}
#kmyBreaksMenu .kmy-break-menu-item svg {flex:none;}
#kmyBreaksMenu .kmy-break-menu-item strong {display:block;font:600 12px "Segoe UI",sans-serif;margin-bottom:3px;}
#kmyBreaksMenu .kmy-break-menu-item small {display:block;font:12px/1.4 "Segoe UI",sans-serif;}
.kmy-break-marker {height:0;min-height:0!important;margin:0!important;padding:0!important;border:0!important;position:relative;}
.kmy-show-marks .kmy-break-marker::after {content:attr(data-label);position:absolute;left:0;right:0;top:-10px;text-align:center;font:9px "Segoe UI",sans-serif;color:#777;border-top:1px dotted #999;pointer-events:none;}
@media print {.kmy-break-marker::after {display:none!important;}}

#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item {display:flex!important;flex-direction:row!important;align-items:center!important;gap:16px!important;padding:9px 18px!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item > span {display:block;flex:1;}

/* Selection highlight supplies focus feedback for the multi-page editing host. */
#kmyWordApp #kmyWordCanvas:focus,
#kmyWordApp #kmyWordCanvas:focus-visible { outline: none !important; }

/* Print the studio instead of the CRM shell. app.css hides non-printRoot body
   children; the ID selector must override that rule without affecting invoices. */
@media print {
  html:has(#kmyWordApp),
  body:has(> #kmyWordApp) {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body > #kmyWordApp {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body:has(> #kmyWordApp) > .printRoot {
    display: none !important;
  }

  #kmyWordApp .kmy-w-main-viewport,
  #kmyWordApp .kmy-w-workspace,
  #kmyWordApp .kmy-w-stage,
  #kmyWordApp .kmy-w-page-row,
  #kmyWordApp .kmy-w-canvas {
    display: block !important;
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    zoom: 1 !important;
    transform: none !important;
  }

  #kmyWordApp .kmy-w-left-ruler-bar {
    display: none !important;
  }

  #kmyWordApp .kmy-w-a4-page {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* File backstage: full editor surface, compact navigation, no blurred modal. */
.kmy-file-backstage {position:fixed;inset:0;z-index:210000;display:grid;grid-template-columns:190px minmax(0,1fr);background:#fff;color:#242424;font:14px "Segoe UI",Arial,sans-serif;overflow:hidden;}
.kmy-file-backstage .kmy-file-nav {background:#185abd;color:#fff;display:flex;flex-direction:column;padding:20px 0;overflow:auto;}
.kmy-file-backstage button {font:inherit;cursor:default;transition:background-color .12s ease,border-color .12s ease;}
.kmy-file-backstage .kmy-file-nav button {border:0;border-radius:0;background:transparent;color:#fff;text-align:left;padding:13px 28px;min-height:44px;}
.kmy-file-backstage .kmy-file-nav button:hover {background:#104caa;}
.kmy-file-backstage .kmy-file-nav button.is-current {background:#fff;color:#185abd;font-weight:600;}
.kmy-file-nav-title {font-size:24px;padding:20px 28px 24px;}
.kmy-file-backstage .kmy-file-back {font-size:22px;}
.kmy-file-back span {font-size:14px;margin-left:12px;}
.kmy-file-content {padding:44px 56px;overflow:auto;max-width:1150px;}
.kmy-file-content h1 {font-size:34px;font-weight:400;margin:0 0 26px;}
.kmy-file-content h2 {font-size:21px;font-weight:600;margin:0 0 8px;overflow-wrap:anywhere;}
.kmy-file-content h3 {font-size:18px;font-weight:600;margin:0 0 12px;}
.kmy-file-content p {color:#606060;line-height:1.5;margin:0 0 18px;}
.kmy-file-content section {padding:26px 0;border-top:1px solid #e2e2e2;}
.kmy-file-content dl {display:grid;grid-template-columns:100px 1fr;gap:12px;margin:0;}
.kmy-file-content dt {color:#666;}.kmy-file-content dd {margin:0;}
.kmy-file-backstage .kmy-file-content button {background:#fff;color:#242424;border:1px solid #bdbdbd;border-radius:3px;padding:9px 20px;min-height:36px;}
.kmy-file-backstage .kmy-file-content button:hover {background:#edf3fb;border-color:#185abd;}
.kmy-file-backstage .kmy-file-save button {background:#185abd;color:#fff;border-color:#185abd;min-width:110px;}
.kmy-file-backstage .kmy-file-save button:hover {background:#104caa;}
.kmy-file-output>div {display:flex;flex-wrap:wrap;gap:10px;}
.kmy-file-backstage button:focus-visible {outline:2px solid #185abd;outline-offset:3px;}
.kmy-file-backstage .kmy-file-nav button:focus-visible {outline:2px solid #fff;outline-offset:-4px;}
@media(max-width:600px){.kmy-file-backstage{grid-template-columns:140px minmax(0,1fr);}.kmy-file-content{padding:24px 20px;}.kmy-file-backstage .kmy-file-nav button{padding:12px 16px;}}
@media(prefers-reduced-motion:reduce){.kmy-file-backstage button{transition:none;}}
@media print{#kmyFileBackstage{display:none!important;}}

/* Match the user's desktop Word Paragraph reference at CSS-pixel scale. */
#kmyParagraphDialogModal {background:transparent;backdrop-filter:none;padding:8px;color-scheme:light;}
#kmyParagraphDialogModal .kmy-w365-dialog {width:584px!important;max-width:calc(100vw - 16px);height:704px;max-height:calc(100dvh - 16px);background:#f0f0f0!important;border:1px solid #bbb;border-radius:9px;box-shadow:0 16px 30px #0003,0 2px 6px #0001;font:12px "Segoe UI",Arial,sans-serif;overflow:hidden;}
#kmyParagraphDialogModal .kmy-w365-titlebar {height:37px;background:#f3f4f8;padding:0 10px;border:0;}
#kmyParagraphDialogModal .kmy-w365-title {font-size:14px;font-weight:400;color:#888;}
#kmyParagraphDialogModal .kmy-w365-ctrl-btn {width:44px;height:34px;color:#888;background:transparent;border:0;border-radius:0;}
#kmyParagraphDialogModal .kmy-w365-ctrl-btn:hover {background:#e5e5e5;}
#kmyParagraphDialogModal .kmy-w365-ctrl-btn.close:hover {background:#c42b1c;color:white;}
#kmyParagraphDialogModal .kmy-w365-tabs {height:37px;gap:0;padding:0 10px;background:#f0f0f0;align-items:flex-end;border:0;}
#kmyParagraphDialogModal .kmy-w365-tab {height:27px!important;border:1px solid #dedede!important;border-radius:0!important;background:#f4f4f4!important;padding:4px 12px!important;color:#111;font:12px "Segoe UI",sans-serif!important;}
#kmyParagraphDialogModal .kmy-w365-tab.active {background:#f9f9f9!important;border-bottom-color:#f9f9f9!important;font-weight:400!important;}
#kmyParagraphDialogModal .kmy-w365-tab:hover {background:#eaf3fc!important;}
#kmyParagraphDialogModal .kmy-w365-body {background:#f9f9f9;margin:0 10px;padding:14px 12px!important;border:1px solid #dedede;border-bottom:0;overflow:auto;min-height:0;}
#kmyParagraphDialogModal .kmy-w365-section-title {font:12px "Segoe UI",sans-serif;color:#111;margin-bottom:10px;}
#kmyParagraphDialogModal .kmy-w365-section-title::after {background:#d9d9d9;}
#kmyParagraphDialogModal .kmy-w365-label,#kmyParagraphDialogModal .kmy-w365-check {font:12px "Segoe UI",sans-serif!important;color:#111;}
#kmyParagraphDialogModal .kmy-w365-check:has(input:disabled) {color:#888;}
#kmyParagraphDialogModal .kmy-w365-select {height:28px!important;min-height:0!important;border:1px solid #aeb0b5!important;border-radius:0!important;padding:2px 4px!important;background:#fff!important;color:#111!important;font:12px "Segoe UI",sans-serif!important;box-shadow:none!important;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap {height:26px;width:84px;border:1px solid #aeb0b5;background:#fff;border-radius:0;box-shadow:none;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap input {font:12px "Segoe UI",sans-serif!important;height:24px!important;background:white!important;color:#111!important;}
#kmyParagraphDialogModal .kmy-w365-spin-unit {color:#111;}
#kmyParagraphDialogModal .kmy-w365-select:focus,#kmyParagraphDialogModal .kmy-w365-spin-wrap:focus-within {outline:0!important;border-color:#0078d4!important;}
#kmyParagraphDialogModal .kmy-para-pair+div {margin-bottom:32px!important;}
#kmyParagraphDialogModal .kmy-paragraph-preview {background:#f9f9f9;margin:0 10px;border:1px solid #dedede;border-top:0;padding:0 12px 16px;}
#kmyParagraphDialogModal .kmy-w365-preview-box {height:113px;margin-left:14px;padding:9px 31px;border:1px solid #777;border-radius:0;background:white;box-shadow:none;overflow:hidden;}
#kmyParagraphDialogModal .kmy-w365-prev-active {font-size:9px!important;color:#111;}
#kmyParagraphDialogModal .kmy-w365-prev-dummy {font-size:8px;color:#b5b5b5;white-space:normal;}
#kmyParagraphDialogModal .kmy-w365-foot {background:#f0f0f0;padding:12px 9px 10px;border:0;gap:50px;}
#kmyParagraphDialogModal .kmy-w365-btn {background:#fdfdfd!important;color:#111!important;border:1px solid #c5c5c5!important;border-radius:3px!important;width:112px!important;min-width:112px!important;height:29px!important;padding:0!important;font:12px "Segoe UI",sans-serif!important;box-shadow:none!important;}
#kmyParagraphDialogModal .kmy-w365-btn.primary {background:#fdfdfd!important;border-color:#0078d4!important;color:#111!important;font-weight:400!important;}
#kmyParagraphDialogModal .kmy-w365-btn:hover {background:#e5f1fb!important;border-color:#0078d4!important;}
#kmyParagraphDialogModal .kmy-w365-btn:focus-visible {outline:1px dotted #333;outline-offset:-4px;}
@media(max-height:680px){#kmyParagraphDialogModal .kmy-para-pair+div{margin-bottom:12px!important;}#kmyParagraphDialogModal .kmy-w365-preview-box{height:80px;}#kmyParagraphDialogModal .kmy-w365-body{padding-top:8px!important;}}
@media(max-width:590px){#kmyParagraphDialogModal .kmy-para-general,#kmyParagraphDialogModal .kmy-para-pair{grid-template-columns:1fr!important;}#kmyParagraphDialogModal .kmy-para-general>.kmy-w365-check{grid-column:1;grid-row:auto;}#kmyParagraphDialogModal .kmy-w365-foot{display:flex;flex-wrap:wrap;gap:8px;}#kmyParagraphDialogModal .kmy-w365-foot>div:first-child{gap:8px!important;}}


/* Compact Paragraph sizing; keep native Word proportions at browser scaling. */
#kmyParagraphDialogModal .kmy-w365-dialog {width:540px!important;height:630px;animation:kmyParagraphOpen 140ms cubic-bezier(.2,.7,.2,1)!important;}
#kmyParagraphDialogModal .kmy-para-general {grid-template-columns:240px minmax(0,1fr)!important;gap:5px 12px!important;}
#kmyParagraphDialogModal .kmy-para-general .kmy-w365-label {width:96px;padding-left:10px;}
#kmyParagraphDialogModal .kmy-para-general select {width:144px;}
#kmyParagraphDialogModal .kmy-para-pair {grid-template-columns:226px minmax(0,1fr)!important;padding-left:10px;gap:12px!important;}
#kmyParagraphDialogModal .kmy-para-special {grid-template-columns:minmax(0,1fr) 76px;gap:10px!important;min-width:0;}
#kmyParagraphDialogModal .kmy-para-special select {width:100%;min-width:0;}
#kmyParagraphDialogModal .kmy-w365-spin-wrap {width:76px;}
#kmyParagraphDialogModal .kmy-para-direction {padding-left:10px;}
#kmyParagraphDialogModal .kmy-para-direction>div {grid-template-columns:72px 144px minmax(0,1fr);gap:12px!important;}
#kmyParagraphDialogModal .kmy-para-pair+div {padding-left:10px;margin-bottom:18px!important;}
#kmyParagraphDialogModal .kmy-w365-body {padding-top:10px!important;padding-bottom:4px!important;overflow-x:hidden;}
#kmyParagraphDialogModal .kmy-paragraph-preview {padding-bottom:10px;}
#kmyParagraphDialogModal .kmy-w365-preview-box {height:88px;padding:7px 24px;margin-left:10px;}
#kmyParagraphDialogModal .kmy-w365-foot {gap:28px;padding-top:10px;padding-bottom:9px;}
#kmyParagraphDialogModal .kmy-w365-foot>div:first-child {gap:28px!important;}
#kmyParagraphDialogModal .kmy-w365-foot>div {gap:12px!important;}
#kmyParagraphDialogModal .kmy-w365-btn {width:100px!important;min-width:100px!important;}
#kmyParagraphDialogModal :is(.kmy-w365-btn,.kmy-w365-tab,.kmy-w365-ctrl-btn,.kmy-w365-select,.kmy-w365-spin-wrap) {transition:background-color 110ms ease-out,border-color 110ms ease-out,color 110ms ease-out;}
#kmyParagraphDialogModal .kmy-w365-btn:active {background:#cce4f7!important;border-color:#005a9e!important;}
@keyframes kmyParagraphOpen {from{opacity:0;translate:0 4px;}to{opacity:1;translate:0 0;}}
@media(max-width:550px){#kmyParagraphDialogModal .kmy-para-general,#kmyParagraphDialogModal .kmy-para-pair{grid-template-columns:1fr!important;}#kmyParagraphDialogModal .kmy-para-general>.kmy-w365-check{grid-column:1;grid-row:auto;}#kmyParagraphDialogModal .kmy-para-direction>div{display:flex!important;flex-wrap:wrap;}#kmyParagraphDialogModal .kmy-w365-foot{display:flex;flex-wrap:wrap;gap:8px;}}
@media(prefers-reduced-motion:reduce){#kmyParagraphDialogModal .kmy-w365-dialog{animation:none!important;}#kmyParagraphDialogModal *{transition:none!important;}}

/* Refine compact Word dialog and crisp native-style number steppers. */
#kmyParagraphDialogModal .kmy-w365-dialog {width:500px!important;animation:kmyParagraphOpen 180ms cubic-bezier(.16,1,.3,1)!important;}
#kmyParagraphDialogModal .kmy-para-general {grid-template-columns:224px minmax(0,1fr)!important;gap:5px 10px!important;}
#kmyParagraphDialogModal .kmy-para-general .kmy-w365-label {width:90px;padding-left:6px;}
#kmyParagraphDialogModal .kmy-para-general select {width:134px;}
#kmyParagraphDialogModal .kmy-para-pair {grid-template-columns:198px minmax(0,1fr)!important;padding-left:6px;gap:10px!important;}
#kmyParagraphDialogModal .kmy-para-special {grid-template-columns:minmax(0,1fr) 76px;gap:8px!important;}
#kmyParagraphDialogModal .kmy-para-direction {padding-left:6px;}
#kmyParagraphDialogModal .kmy-para-direction>div {grid-template-columns:74px 134px minmax(0,1fr);gap:10px!important;}
#kmyParagraphDialogModal .kmy-w365-foot {gap:18px;}
#kmyParagraphDialogModal .kmy-w365-foot>div:first-child {gap:18px!important;}
#kmyParagraphDialogModal .kmy-w365-btn {width:96px!important;min-width:96px!important;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper {width:14px;right:1px;top:1px;bottom:1px;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button {position:relative;width:14px!important;height:11px!important;font-size:0!important;background:linear-gradient(#fff,#f3f3f3)!important;border-color:#b7b7b7!important;transition:background-color 140ms ease,border-color 140ms ease;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button+button {border-top:0!important;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button::after {content:"";position:absolute;left:4px;top:3px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:3px solid #252525;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button+button::after {border-bottom:0;border-top:3px solid #252525;top:4px;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button:hover {background:#e5f1fb!important;border-color:#7eb4df!important;}
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button:active {background:#cce4f7!important;border-color:#569de5!important;}
@media(prefers-reduced-motion:reduce){#kmyParagraphDialogModal .kmy-w365-dialog{animation:none!important;}:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-stepper button{transition:none!important;}}

/* One quiet opening motion for both dialogs; dragging paints on animation frames. */
:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-w365-dialog {animation:kmyWordDialogOpen 220ms cubic-bezier(.22,1,.36,1)!important;}
@keyframes kmyWordDialogOpen {from{opacity:0;translate:0 6px;}to{opacity:1;translate:0 0;}}
@media(prefers-reduced-motion:reduce){:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-w365-dialog{animation:none!important;}}

/* Consistent motion across the editor chrome, never the editable document. */
#kmyWordApp {--kmy-motion-ease:cubic-bezier(.22,1,.36,1);}
#kmyWordApp .kmy-w-ribbon-pane.active {animation:kmyRibbonReveal 220ms var(--kmy-motion-ease)!important;}
#kmyWordApp .kmy-w-tab.active::after {animation:kmyTabReveal 180ms var(--kmy-motion-ease)!important;transform-origin:center;}
#kmyWordApp .kmy-popover.show {animation:kmyChromeReveal 200ms var(--kmy-motion-ease)!important;transform-origin:top left;}
#kmyWordApp :is(.kmy-styles-drawer,.kmy-file-backstage) {animation:kmyChromeReveal 240ms var(--kmy-motion-ease)!important;}
.kmy-w365-overlay .kmy-w365-dialog,.kmy-dialog-overlay .kmy-dialog-box,.kmy-setup-dialog {animation:kmyChromeReveal 240ms cubic-bezier(.22,1,.36,1)!important;}
#kmyWordApp :is(button,.kmy-popover-item,.kmy-w-tab,.kmy-style-btn) {transition:background-color 160ms ease,border-color 160ms ease,color 160ms ease,box-shadow 160ms ease!important;}
#kmyWordApp :is(.kmy-wimg-box,.kmy-shape,.kmy-w-content) {transition:none!important;}
@keyframes kmyRibbonReveal {from{opacity:.35;translate:0 4px;}to{opacity:1;translate:0 0;}}
@keyframes kmyChromeReveal {from{opacity:0;translate:0 7px;}to{opacity:1;translate:0 0;}}
@keyframes kmyTabReveal {from{opacity:.4;scale:.55 1;}to{opacity:1;scale:1 1;}}
@media(prefers-reduced-motion:reduce){
 #kmyWordApp .kmy-w-ribbon-pane.active,#kmyWordApp .kmy-w-tab.active::after,#kmyWordApp .kmy-popover.show,#kmyWordApp :is(.kmy-styles-drawer,.kmy-file-backstage),.kmy-w365-overlay .kmy-w365-dialog,.kmy-dialog-overlay .kmy-dialog-box,.kmy-setup-dialog {animation:none!important;}
}

#kmyWordApp :is(.kmy-w365-dialog,.kmy-dialog-box,.kmy-setup-dialog) {animation:kmyChromeReveal 240ms cubic-bezier(.22,1,.36,1)!important;}
@media(prefers-reduced-motion:reduce){#kmyWordApp :is(.kmy-w365-dialog,.kmy-dialog-box,.kmy-setup-dialog){animation:none!important;}}

/* Compact, aligned secondary ribbon tabs. */
#kmyWordApp .kmy-w-ribbon-body:has(:is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view).active) {height:104px!important;min-height:104px!important;max-height:104px!important;padding:4px 8px!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) {min-height:94px!important;padding:0 4px!important;gap:0!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .kmy-w-group {min-height:94px!important;padding:0 10px!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .kmy-w-group-tools {padding-top:0!important;justify-content:center!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .kmy-w-row {align-items:center!important;gap:3px!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .big-btn {height:68px!important;min-height:68px!important;min-width:50px!important;max-width:76px!important;padding:4px 5px!important;gap:4px!important;justify-content:flex-start!important;font:11px/14px "Segoe UI",sans-serif!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .big-btn>.kmy-svg-icon {width:24px!important;height:24px!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .kmy-w-group-title {font:10px/15px "Segoe UI",sans-serif!important;margin-top:0!important;min-height:15px;}
#kmyWordApp .kmy-document-style-gallery {gap:4px;align-self:center;}
#kmyWordApp .kmy-document-style-card {width:78px;height:68px;gap:2px;padding:5px 6px;font-size:10px;}
#kmyWordApp .kmy-document-style-card strong {font-size:17px;line-height:20px;}
#kmyWordApp .kmy-document-style-card small {font-size:9px;line-height:11px;}
#kmyWordApp .kmy-layout-fields {grid-template-columns:114px 114px!important;gap:5px 12px!important;font:11px "Segoe UI",sans-serif;}
#kmyWordApp .kmy-layout-fields label {display:grid!important;grid-template-columns:34px 52px 16px;gap:4px!important;font:11px "Segoe UI",sans-serif!important;justify-content:start!important;}
#kmyWordApp .kmy-layout-fields input {width:52px!important;height:23px!important;min-height:23px!important;max-height:23px!important;font-size:11px!important;padding:1px 3px!important;}
#kmyWordApp .kmy-view-checks {gap:7px;padding:2px 5px;}
#kmyWordApp .kmy-view-checks label {font-size:11px;}
#kmyWordApp #kmyPane_view .kmy-ribbon-stack .kmy-btn-tool {height:26px!important;min-height:26px!important;font-size:11px!important;gap:5px;}
#kmyWordApp #kmyPane_view .kmy-ribbon-stack svg {width:16px;height:16px;}
/* Slightly longer easing across editor chrome. */
#kmyWordApp .kmy-w-ribbon-pane.active {animation-duration:300ms!important;}
#kmyWordApp .kmy-w-tab.active::after {animation-duration:240ms!important;}
#kmyWordApp .kmy-popover.show {animation-duration:280ms!important;}
#kmyWordApp :is(.kmy-styles-drawer,.kmy-file-backstage,.kmy-w365-dialog,.kmy-dialog-box,.kmy-setup-dialog),.kmy-w365-overlay .kmy-w365-dialog,.kmy-dialog-overlay .kmy-dialog-box,.kmy-setup-dialog,:is(#kmyParagraphDialogModal,#kmyTabsDialogModal) .kmy-w365-dialog {animation-duration:300ms!important;}
@media(prefers-reduced-motion:reduce){#kmyWordApp .kmy-w-ribbon-pane.active,#kmyWordApp .kmy-w-tab.active::after,#kmyWordApp .kmy-popover.show {animation:none!important;}}

#kmyWordApp #kmyPane_layout .kmy-layout-fields>.kmy-layout-launcher {position:absolute!important;bottom:0;right:2px;width:12px!important;height:12px!important;min-height:0!important;}
#kmyWordApp #kmyPane_layout .kmy-layout-fields input {height:23px!important;min-height:23px!important;max-height:23px!important;font-size:11px!important;}
#kmyWordApp :is(#kmyPane_design,#kmyPane_layout,#kmyPane_review,#kmyPane_view) .kmy-w-group-tools {min-height:0;}

#kmyWordApp #kmyPane_view .kmy-view-checks label {height:18px;min-height:18px;line-height:18px;padding:0!important;margin:0!important;}
#kmyWordApp #kmyPane_view .kmy-view-checks input[type=checkbox] {width:13px!important;height:13px!important;min-height:13px!important;max-height:13px!important;padding:0!important;margin:0!important;flex:none;}

/* Readable Word-style break labels in the final column, outside document text. */
#kmyWordApp .kmy-break-marker {height:16px;min-height:16px!important;}
#kmyWordApp .kmy-break-marker::after {display:none!important;}
#kmyWordApp .kmy-formatting-marks .kmy-break-display {display:flex;align-items:center;gap:3px;color:#222;white-space:nowrap;font-family:"Segoe UI",sans-serif;pointer-events:none;}
#kmyWordApp .kmy-break-display::before,#kmyWordApp .kmy-break-display::after {content:"";flex:1;min-width:6px;border-top:1px dotted #555;}
#kmyWordApp .kmy-break-display b {font:inherit;font-weight:400;color:#222;background:white;padding:0 2px;}
@media print{#kmyWordApp .kmy-break-marker {height:0;min-height:0!important;}#kmyWordApp .kmy-break-display{display:none!important;}}

#kmyWordApp .kmy-continuous-section > :first-child { margin-top: 0 !important; }

/* Compact Word-style Columns dialog. */
#kmyRibbonDialog.kmy-columns-dialog {background:transparent!important;backdrop-filter:none!important;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-ribbon-dialog {box-sizing:border-box;width:570px!important;max-width:calc(100vw - 24px)!important;padding:0 10px 10px!important;background:#f0f0f0!important;color:#111;border:1px solid #b9b9b9;border-radius:10px;font:12px/1.35 "Segoe UI",sans-serif;box-shadow:0 18px 38px #0003;max-height:calc(100vh - 24px);overflow:auto;}
.kmy-columns-dialog h3 {display:flex;align-items:center;justify-content:space-between;font:14px/36px "Segoe UI",sans-serif!important;color:#888;margin:0 -10px 10px!important;padding:0 10px;background:#f4f4f8;}
.kmy-columns-dialog h3 button {width:30px;height:30px;padding:0;border:0!important;background:transparent!important;font-size:22px;color:#888;}
.kmy-columns-dialog fieldset {min-width:0;padding:10px 12px;border:1px solid #dadada;margin:0!important;}
.kmy-columns-dialog legend {font:12px "Segoe UI",sans-serif;padding:0 4px;color:#111;}
.kmy-columns-dialog .kmy-columns-presets {gap:12px;justify-content:space-between;}
.kmy-columns-dialog .kmy-columns-presets button {width:68px;min-height:60px;padding:3px;gap:5px;border:0;background:transparent;font:12px "Segoe UI",sans-serif;color:#111;}
.kmy-columns-dialog .kmy-columns-presets svg {width:36px;height:42px;}
.kmy-columns-dialog .kmy-columns-presets svg path {stroke:#222;}
.kmy-columns-dialog .kmy-columns-presets button[aria-pressed=true] svg {outline:1px solid #0078d7;outline-offset:2px;}
.kmy-columns-dialog .kmy-columns-presets button:hover {background:#e4edf5;}
.kmy-columns-dialog .kmy-columns-options {display:grid;grid-template-columns:350px 1fr;align-items:start;margin:8px 0!important;gap:8px;}
.kmy-columns-dialog .kmy-columns-options > label {display:flex;align-items:center;gap:12px;padding-top:8px;}
.kmy-columns-dialog .kmy-column-switches {display:grid;gap:5px;}
.kmy-columns-dialog label {font:12px "Segoe UI",sans-serif;color:#111;}
.kmy-columns-dialog input,.kmy-columns-dialog select {box-sizing:border-box;font:12px "Segoe UI",sans-serif!important;height:27px!important;min-height:0!important;border:1px solid #a6a9b0;border-radius:0!important;background:white;color:#111;padding:2px 4px!important;}
.kmy-columns-dialog input[type=checkbox] {appearance:auto!important;width:15px!important;height:15px!important;min-width:0!important;vertical-align:middle;accent-color:#0078d7;margin:0 5px 0 0!important;}
.kmy-columns-dialog input:disabled {background:#eee;color:#999;}
.kmy-columns-dialog label:has(input:disabled) {color:#888;}
.kmy-columns-dialog #kmyColumnCount {width:65px;}
.kmy-columns-dialog .kmy-column-main {display:grid;grid-template-columns:350px 1fr;gap:14px;}
.kmy-columns-dialog #kmyColumnRows {display:grid;grid-template-columns:44px 110px 110px;gap:4px 12px;max-height:135px;overflow:auto;margin:0 0 10px;}
.kmy-columns-dialog .kmy-column-index {border:1px solid #a6a9b0;height:25px;display:grid;place-items:center;background:#eee;}
.kmy-columns-dialog #kmyColumnRows .kmy-column-unit {position:relative;display:block;}
.kmy-columns-dialog .kmy-column-unit input {width:110px!important;padding-right:35px!important;}
.kmy-columns-dialog .kmy-column-unit span {position:absolute;right:21px;top:6px;pointer-events:none;font-size:11px;}
.kmy-columns-dialog .kmy-column-unit:has(input:disabled) span {display:none;}
.kmy-columns-dialog #kmyColumnPreview {box-sizing:border-box;width:100px;height:142px;margin:0 auto;padding:10px;background:white;border:1px solid #222;box-shadow:1px 2px 4px #0004;gap:0;}
.kmy-columns-dialog #kmyColumnPreview i {height:1px;background:#222;margin:2px 0;}
.kmy-columns-dialog .kmy-column-bottom {display:grid;grid-template-columns:350px 1fr;gap:14px;margin-top:7px;align-items:center;}
.kmy-columns-dialog .kmy-column-scope {display:flex;align-items:center;gap:12px;}
.kmy-columns-dialog #kmyColumnScope {width:180px;}
.kmy-columns-dialog small {display:none;}
.kmy-columns-dialog .kmy-ribbon-error {margin:3px 0;min-height:0;font-size:11px;color:#b42318;}
.kmy-columns-dialog footer {display:flex;justify-content:flex-end;gap:15px;margin-top:14px!important;}
.kmy-columns-dialog footer button {width:112px;height:29px;padding:3px!important;font:12px "Segoe UI",sans-serif;border:1px solid #b9b9b9;border-radius:3px;background:white;color:#111;}
.kmy-columns-dialog footer [data-apply] {border-color:#0078d7;}
.kmy-columns-dialog button:focus-visible,.kmy-columns-dialog input:focus-visible,.kmy-columns-dialog select:focus-visible {outline:1px solid #0078d7;outline-offset:1px;}
@media(max-width:590px){.kmy-columns-dialog .kmy-column-main,.kmy-columns-dialog .kmy-columns-options,.kmy-columns-dialog .kmy-column-bottom{grid-template-columns:minmax(0,1fr)!important;}.kmy-columns-dialog .kmy-column-preview-field{display:none;}}

#kmyRibbonDialog.kmy-columns-dialog {color-scheme:light;}
#kmyRibbonDialog.kmy-columns-dialog label {margin:0!important;min-height:0!important;justify-content:flex-start!important;gap:5px;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-columns-options > label {gap:12px;}
#kmyRibbonDialog.kmy-columns-dialog input {color-scheme:light!important;}
#kmyRibbonDialog.kmy-columns-dialog input[type=number]::-webkit-inner-spin-button {opacity:1;}
#kmyRibbonDialog.kmy-columns-dialog input[type=checkbox] {background:white!important;border:1px solid #aaa!important;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-unit input {height:27px!important;}
#kmyRibbonDialog.kmy-columns-dialog #kmyColumnPreview {overflow:hidden;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-scope {gap:12px;}

.kmy-columns-dialog h3 {cursor:move;user-select:none;}.kmy-columns-dialog h3 button {cursor:pointer;}

/* Word desktop numeric controls: framed, stacked 10px arrow buttons. */
#kmyRibbonDialog.kmy-columns-dialog input[type=number] {-moz-appearance:textfield;appearance:textfield;height:26px!important;padding-right:24px!important;}
#kmyRibbonDialog.kmy-columns-dialog input[type=number]::-webkit-inner-spin-button,
#kmyRibbonDialog.kmy-columns-dialog input[type=number]::-webkit-outer-spin-button {-webkit-appearance:none!important;margin:0;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-count-spin {position:relative;display:inline-block;width:65px;height:26px;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper {position:absolute;right:2px;top:2px;bottom:2px;width:17px;display:grid;grid-template-rows:1fr 1fr;gap:1px;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button {box-sizing:border-box;display:grid;place-items:center;width:17px;height:10px;min-height:0!important;min-width:0!important;padding:0!important;margin:0!important;border:1px solid #b5b5b5;border-radius:0;background:linear-gradient(#fafafa,#e8e8e8);box-shadow:none;color:#111;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper i {display:block;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:3px solid #222;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button:last-child i {border-bottom:0;border-top:3px solid #222;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button:hover:not(:disabled) {background:#e5f1fb;border-color:#7eb4ea;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button:active:not(:disabled) {background:#cce4f7;border-color:#0078d7;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button:disabled {background:#f0f0f0;border-color:#d2d2d2;opacity:1;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button:disabled i {border-bottom-color:#aaa;border-top-color:#aaa;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-unit > span:not(.kmy-column-stepper) {right:23px;top:5px;}
#kmyRibbonDialog.kmy-columns-dialog .kmy-column-unit:has(input:disabled) .kmy-column-stepper {display:grid;}
#kmyRibbonDialog.kmy-columns-dialog input:disabled {background:#f0f0f0!important;border-color:#b5b5b5;}
#kmyRibbonDialog.kmy-columns-dialog select {appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='25'%3E%3Cpath d='M0 0v25' stroke='%23aaa'/%3E%3Cpath d='m7 11 4 4 4-4' fill='none' stroke='%23888'/%3E%3C/svg%3E") no-repeat right center!important;padding-right:26px!important;}

#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper,#kmyRibbonDialog.kmy-columns-dialog .kmy-column-stepper button {pointer-events:auto!important;}

#kmyWordApp .kmy-word-page-menu {background:#fff!important;border:1px solid #777!important;border-radius:4px!important;padding:0!important;box-shadow:0 7px 15px #0003!important;color:#111;font:14px 'Segoe UI',sans-serif;overflow:hidden!important;min-width:0!important;}
#kmyWordApp .kmy-word-margin-menu {width:346px!important;display:none;flex-direction:column;}
#kmyWordApp .kmy-word-margin-menu.show {display:flex!important;}
#kmyWordApp .kmy-w-dropdown:has(>.kmy-word-page-menu.show)>button,#kmyWordApp .kmy-w-dropdown:has(>#kmyBreaksMenu.show)>button {background:#ebebeb!important;border-color:#888!important;box-shadow:none!important;}
#kmyWordApp .kmy-word-size-menu {width:306px!important;display:none;flex-direction:column;}
#kmyWordApp .kmy-word-size-menu.show {display:flex!important;}
#kmyWordApp .kmy-paper-menu-scroll {overflow-y:auto;min-height:0;flex:1;max-height:600px;}
#kmyWordApp .kmy-word-orient-menu {width:160px!important;}
#kmyWordApp .kmy-page-menu-item {display:flex!important;align-items:center!important;gap:14px!important;width:100%;margin:0!important;border:0!important;border-radius:0!important;padding:7px 10px!important;background:#fff;color:#111;text-align:left;font:14px/1.4 'Segoe UI',sans-serif;white-space:normal;min-height:60px;box-shadow:none!important;}
#kmyWordApp .kmy-page-menu-item.is-selected,#kmyWordApp .kmy-page-menu-item:hover {background:#ebebeb!important;}
#kmyWordApp .kmy-page-menu-item:focus-visible {outline:1px solid #1673bd!important;outline-offset:-2px;}
#kmyWordApp .kmy-page-menu-icon {display:flex;align-items:center;justify-content:center;flex:0 0 48px;width:48px;height:48px;}
#kmyWordApp .kmy-page-menu-icon svg {width:40px;height:44px;}
#kmyWordApp .kmy-page-menu-item.is-selected .kmy-page-menu-icon {background:white;}
#kmyWordApp .kmy-page-menu-item strong {display:block;font-weight:600;font-size:14px;line-height:1.4;}
#kmyWordApp .kmy-page-menu-item small {display:block;font-size:14px;line-height:1.4;margin-top:2px;}
#kmyWordApp .kmy-word-margin-menu .kmy-page-menu-item {min-height:88px;gap:16px!important;}
#kmyWordApp .kmy-word-margin-menu .kmy-page-menu-icon {flex-basis:64px;width:64px;height:70px;}
#kmyWordApp .kmy-margin-values {display:grid;grid-template-columns:1fr 1fr;column-gap:12px;white-space:nowrap;font-size:13px;}
#kmyWordApp .kmy-margin-values>span {display:flex;justify-content:space-between;gap:5px;}
#kmyWordApp .kmy-margin-values b {font-weight:400;}
#kmyWordApp .kmy-page-menu-footer {display:block;flex:none;width:100%;padding:10px 14px!important;border:0!important;border-top:1px solid #d0d0d0!important;border-radius:0!important;background:white;text-align:left;font:14px 'Segoe UI',sans-serif;}
#kmyWordApp .kmy-page-menu-footer:hover {background:#ebebeb;}
#kmyWordApp #kmyBreaksMenu {width:392px!important;min-width:0!important;padding:0!important;border:1px solid #777!important;border-radius:4px!important;background:white!important;box-shadow:0 7px 15px #0003!important;overflow-y:auto!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-heading {font:600 14px 'Segoe UI',sans-serif;padding:10px 18px;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item {min-height:78px;gap:22px!important;padding:9px 24px!important;border-radius:0!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item:hover {background:#ebebeb!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item strong {font:600 14px 'Segoe UI',sans-serif;margin-bottom:3px;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item small {font:14px/1.4 'Segoe UI',sans-serif;}

/* Compact desktop page galleries, including Windows display scaling. */
#kmyWordApp .kmy-word-margin-menu {width:280px!important;}
#kmyWordApp .kmy-word-size-menu {width:246px!important;}
#kmyWordApp .kmy-word-orient-menu {width:128px!important;}
#kmyWordApp .kmy-page-menu-item {min-height:46px;padding:5px 8px!important;gap:10px!important;font:12px/1.35 "Segoe UI",sans-serif;}
#kmyWordApp .kmy-page-menu-icon {flex-basis:36px;width:36px;height:36px;}
#kmyWordApp .kmy-page-menu-icon svg {width:30px;height:34px;}
#kmyWordApp .kmy-page-menu-item strong,#kmyWordApp .kmy-page-menu-item small {font-size:12px;line-height:1.35;}
#kmyWordApp .kmy-word-margin-menu .kmy-page-menu-item {min-height:66px;gap:10px!important;}
#kmyWordApp .kmy-word-margin-menu .kmy-page-menu-icon {flex-basis:46px;width:46px;height:50px;}
#kmyWordApp .kmy-margin-values {font-size:11px;column-gap:8px;}
#kmyWordApp .kmy-margin-values>span {gap:3px;}
#kmyWordApp .kmy-page-menu-footer {padding:7px 10px!important;font-size:12px;}
#kmyWordApp #kmyBreaksMenu {width:314px!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-heading {font:600 12px "Segoe UI",sans-serif;padding:7px 14px;line-height:16px;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item {min-height:60px;gap:16px!important;padding:7px 18px!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item svg {width:28px!important;height:34px!important;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item strong {font:600 12px/1.35 "Segoe UI",sans-serif;margin-bottom:2px;}
#kmyWordApp #kmyBreaksMenu .kmy-break-menu-item small {font:12px/1.35 "Segoe UI",sans-serif;}

@media screen {
 #kmyWordApp.kmy-two-page-view #kmyWordStage {width:max-content!important;min-width:0!important;max-width:none!important;}
 #kmyWordApp.kmy-two-page-view #kmyWordCanvas {display:grid!important;grid-template-columns:repeat(2,max-content);width:max-content!important;min-width:0!important;max-width:none!important;gap:28px;align-items:start;}
 #kmyWordApp .kmy-page-del {opacity:0;transition:opacity 150ms ease;z-index:20;}
 #kmyWordApp .kmy-w-a4-page:hover>.kmy-page-del,#kmyWordApp .kmy-page-del:focus-visible {opacity:1;}
 #kmyWordApp .kmy-page-del:disabled {display:none;}
}
