/* ==========================================================================
   Theme Variables & Base Reset
   ========================================================================== */
:root,
body[data-theme="minimal"] {
  --accent: #27272a;
  --accent-soft: #fafafa;
  --accent-border: #e4e4e7;
  --section-bg: #f4f4f5;
  --section-ink: #18181b;
  --section-sub: #71717a;
  --ink: #18181b;
  --ink-muted: #71717a;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --header-rule: #27272a;
  --surface-tint: #fafafa;
  --paper-bg: #ffffff;
  --desk-bg: #eceef1;
  --font-main: "Sarabun", "Noto Sans Thai", "Leelawadee UI", "Tahoma", sans-serif;
}

body[data-theme="navy"] {
  --accent: #4f646c;
  --accent-soft: #eef2f4;
  --accent-border: #d4d4d8;
  --section-bg: linear-gradient(90deg, #8b9fa7 0%, #9AAEB5 58%, #b2c3c9 100%);
  --section-ink: #1b2428;
  --section-sub: #384950;
  --ink: #1d2629;
  --ink-muted: #55666d;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --header-rule: #d4d4d8;
  --surface-tint: #eef2f4;
}

body[data-theme="emerald"] {
  --accent: #5b6545;
  --accent-soft: #f3f5ee;
  --accent-border: #d4d4d8;
  --section-bg: linear-gradient(90deg, #838e6c 0%, #939E7B 58%, #aab496 100%);
  --section-ink: #1d2317;
  --section-sub: #38412d;
  --ink: #22271b;
  --ink-muted: #58604a;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --header-rule: #d4d4d8;
  --surface-tint: #eef1e7;
}

body[data-theme="sage-smoke"] {
  --accent: #5d6974;
  --accent-soft: #f3f6f4;
  --accent-border: #d4d4d8;
  --section-bg: linear-gradient(90deg, #626e79 0%, #7D8A96 54%, #A4B3A4 100%);
  --section-ink: #ffffff;
  --section-sub: rgba(255, 255, 255, 0.92);
  --ink: #242b30;
  --ink-muted: #5a6568;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --header-rule: #d4d4d8;
  --surface-tint: #e8ede9;
}

body[data-theme="earth-ivory"] {
  --accent: #7A7463;
  --accent-soft: #F5EFE6;
  --accent-border: #d4d4d8;
  --section-bg: linear-gradient(90deg, #7A7463 0%, #8A5A4A 60%, #C49A6C 100%);
  --section-ink: #ffffff;
  --section-sub: rgba(255, 255, 255, 0.92);
  --ink: #2e2620;
  --ink-muted: #6a5f53;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --header-rule: #d4d4d8;
  --surface-tint: #f2ebe1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.docforms-print-mirror {
  display: none;
}

.logo-box.has-logo .logo-placeholder {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--desk-bg);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Screen Toolbar (Hidden on Print)
   ========================================================================== */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  color: #18181b;
  border-bottom: 1px solid #e4e4e7;
  box-shadow: 0 2px 10px rgba(24, 24, 27, 0.05);
}

.toolbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #52525b;
  background: #ffffff;
  border: 1px solid #e4e4e7;
}

.nav-tab:hover {
  background: #f4f4f5;
  color: #18181b;
}

.nav-tab.is-active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

.font-color-control {
  gap: 4px;
}

.color-picker-input {
  width: 26px;
  height: 24px;
  padding: 1px;
  border: 1px solid #d4d4d8;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
}

.btn-icon-reset {
  border: 1px solid #d4d4d8;
  background: #f4f4f5;
  color: #18181b;
  border-radius: 4px;
  width: 22px;
  height: 24px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.btn-icon-reset:hover {
  background: #e4e4e7;
}

.toolbar-brand {
  font-size: 14px;
  color: #18181b;
}

.toolbar-badge {
  background: #f4f4f5;
  color: #27272a;
  border: 1px solid #d4d4d8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.control-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #52525b;
}

.control-item select {
  background: #fafafa;
  color: #18181b;
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.control-item select:focus {
  outline: 2px solid #a1a1aa;
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: #18181b;
  color: #ffffff;
}

.btn-primary:hover {
  background: #27272a;
}

.btn-secondary {
  background: #f4f4f5;
  color: #27272a;
  border-color: #d4d4d8;
}

.btn-secondary:hover {
  background: #e4e4e7;
}

.btn-ghost {
  background: #ffffff;
  color: #52525b;
  border-color: #e4e4e7;
}

.btn-ghost:hover {
  background: #f4f4f5;
  color: #18181b;
}

.toolbar-hint {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5px 16px 7px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #71717a;
  border-top: 1px solid #f4f4f5;
}

.save-status {
  color: #52525b;
  font-weight: 600;
}

/* ==========================================================================
   A4 Paper Workspace
   ========================================================================== */
.workspace {
  padding: 28px 16px 40px;
  display: flex;
  justify-content: center;
}

.pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.a4-sheet {
  --ink: var(--doc-ink, #18181b);
  font-family: var(--doc-font, var(--font-main));
  color: var(--ink);
  width: 210mm;
  min-height: 297mm;
  padding: 8mm 9mm;
  background: var(--paper-bg);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
}

.pages-container.is-measuring .a4-sheet {
  height: auto !important;
  min-height: 0 !important;
}

.pages-container.is-measuring .form-body {
  flex: 0 0 auto !important;
}

.pages-container.is-measuring .bottom-signoff-group,
.pages-container.is-measuring .signature-grid {
  margin-top: 0 !important;
}

.page-indicator {
  position: absolute;
  top: -20px;
  right: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: #52525b;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   Document Header (Open / Borderless Minimal Header)
   ========================================================================== */
.doc-header {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
  border: none;
  padding: 2px 0 6px;
  background: transparent;
}

.header-org {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 8px;
  border-right: none;
}

.logo-box {
  position: relative;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border: 1.25px dashed var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  cursor: pointer;
  overflow: hidden;
}

.logo-box.has-logo {
  border-style: solid;
  border-color: transparent;
  background: transparent;
}

.logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--ink-muted);
}

.logo-icon {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent);
}

.logo-sub {
  font-size: 9.5px;
  line-height: 1.2;
}

.logo-clear {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.org-details {
  flex: 1;
  min-width: 0;
}

.org-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.org-meta {
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--ink-muted);
}

.header-docbox {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.doc-title-th {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  line-height: 1.2;
}

.doc-title-en {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--ink-muted);
  text-align: right;
  margin-bottom: 4px;
}

.doc-meta-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.doc-meta-mini th,
.doc-meta-mini td {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 2px 4px;
}

.doc-meta-mini th {
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  text-align: left;
  width: 42%;
  white-space: nowrap;
}

/* ==========================================================================
   Form Content Blocks
   ========================================================================== */
.form-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.section-card {
  border: 1px solid var(--line-dark);
  background: #ffffff;
}

.section-header {
  background: var(--section-bg);
  color: var(--section-ink);
  border-bottom: 1px solid var(--line-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.1px;
}

.section-header-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--section-sub);
  letter-spacing: 0.3px;
}

/* Key-Value Metadata Grid */
.info-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.info-grid th,
.info-grid td {
  border: 1px solid var(--line);
  padding: 4px 7px;
  vertical-align: middle;
}

.info-grid th {
  background: var(--surface-tint);
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  width: 17%;
  white-space: nowrap;
}

.info-grid td {
  width: 33%;
}

/* Checkbox Strip */
.check-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 7px 10px;
  background: var(--accent-soft);
  border-top: 1px solid var(--line);
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
}

.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

/* Editable Inputs & Textareas */
.editable {
  outline: none;
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.editable:hover,
.editable:focus {
  background: rgba(37, 99, 235, 0.06);
}

.inline-input,
.cell-input,
.cell-select,
.area-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
  padding: 1px 3px;
}

.inline-input.bold {
  font-weight: 700;
}

.inline-input:hover,
.cell-input:hover,
.cell-select:hover,
.area-input:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.inline-input:focus,
.cell-input:focus,
.cell-select:focus,
.area-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
}

.area-input {
  resize: vertical;
  min-height: 44px;
  line-height: 1.4;
}

.auto-wrap {
  display: block;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  min-height: 18px;
}

/* ==========================================================================
   Document & Drawing Table
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.data-table thead th {
  background: var(--surface-tint);
  color: var(--ink);
  font-weight: 700;
  border: 1px solid var(--line-dark);
  border-top: none;
  padding: 6px 6px;
  text-align: center;
  white-space: nowrap;
}

body[data-theme="navy"] .data-table thead th {
  background: #dce5e8;
  color: #1b2428;
}

body[data-theme="navy"] .data-table tbody tr:nth-child(even) {
  background: #f6f8f9;
}

body[data-theme="emerald"] .data-table thead th {
  background: #e2e7d8;
  color: #1d2317;
}

body[data-theme="emerald"] .data-table tbody tr:nth-child(even) {
  background: #f6f8f2;
}

body[data-theme="sage-smoke"] .data-table thead th {
  background: #e4ebe6;
  color: #364147;
}

body[data-theme="sage-smoke"] .data-table tbody tr:nth-child(even) {
  background: #f6f8f6;
}

body[data-theme="earth-ivory"] .data-table thead th {
  background: #efe5d8;
  color: #4d3b32;
}

body[data-theme="earth-ivory"] .data-table tbody tr:nth-child(even) {
  background: #faf6ef;
}

.data-table tbody td {
  border: 1px solid var(--line);
  padding: 4px 5px;
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

.col-no {
  width: 34px;
  text-align: center;
  color: var(--ink-muted);
  font-weight: 600;
}

.col-center {
  text-align: center;
}

.col-actions {
  width: 52px;
  text-align: center;
  white-space: nowrap;
}

.row-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 3px;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #18181b;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
}

.row-open-link:hover {
  background: #f4f4f5;
  border-color: #18181b;
}

.row-del-btn {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 3px;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.row-del-btn:hover {
  background: #fee2e2;
}

.table-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 9px;
  background: var(--surface-tint);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-muted);
}

.table-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-add-btn {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.inline-add-btn:hover {
  filter: brightness(0.96);
}

/* Status Badges & Summary Strip (Register Template) */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 7px 9px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--line);
}

.summary-pill {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.summary-pill strong {
  font-size: 13px;
  color: var(--accent);
}

.status-select {
  font-weight: 600;
  border-radius: 3px;
  padding: 2px 4px;
  text-align: center;
}

.status-active {
  color: #212b1e;
  background: #A8B49A;
  border: 1px solid #8d9c7e;
}

.status-pending,
.status-revision {
  color: #2e2c2a;
  background: #FCC963;
  border: 1px solid #dfb050;
}

.status-obsolete {
  color: #ffffff;
  background: #C27C5E;
  border: 1px solid #a66346;
  text-decoration: line-through;
}

/* Comparison / Revision Box (DCR Template) */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.split-pane {
  padding: 6px 9px;
}

.split-pane + .split-pane {
  border-left: 1px solid var(--line);
}

.pane-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}

/* ==========================================================================
   Notes & Signature Block
   ========================================================================== */
.notes-box {
  padding: 6px 9px;
  font-size: 10.5px;
}

.notes-label {
  font-weight: 700;
  font-size: 10.5px;
  margin-bottom: 2px;
  color: var(--ink);
}

.bottom-signoff-group {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.bottom-signoff-group .signature-grid {
  margin-top: 0;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line-dark);
  margin-top: auto;
  break-inside: avoid;
  page-break-inside: avoid;
}

.signature-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.signature-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.signature-grid.cols-2 .sig-box {
  min-height: 82px;
}

.signature-grid.cols-2 .sig-box:nth-child(odd) {
  border-left: none;
}

.signature-grid.cols-2 .sig-box:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.sig-box {
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 92px;
  text-align: center;
}

.sig-box + .sig-box {
  border-left: 1px solid var(--line);
}

.sig-role {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-tint);
  border-bottom: 1px solid var(--line);
  margin: -7px -8px 8px;
  padding: 3.5px 6px;
}

.sig-role-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding: 0 4px;
}

.sig-role-input:hover {
  border-color: var(--line-dark);
  background: #ffffff;
}

.sig-role-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
}

/* Memo Specific Helpers */
.memo-body-wrap {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.important-callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--header-rule);
  background: var(--surface-tint);
  padding: 6px 9px;
}

.important-callout-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.memo-closing {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
  padding-top: 2px;
}

.check-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  padding: 8px 12px;
  background: var(--accent-soft);
}

.sig-line {
  border-bottom: 1px dotted var(--line-dark);
  height: 28px;
  margin: 4px 6px;
}

.sig-meta {
  font-size: 9.5px;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sig-meta input {
  text-align: center;
  font-size: 9.5px;
}

/* ==========================================================================
   A4 Landscape & Memo Landscape Format (297mm x 210mm)
   ========================================================================== */
.a4-sheet[data-orientation="landscape"] {
  width: 297mm;
  min-height: 210mm;
  padding: 7.5mm 9mm;
  gap: 7px;
}

.pages-container.is-measuring .a4-sheet[data-orientation="landscape"] {
  height: 210mm;
  min-height: 210mm;
}

.a4-sheet[data-orientation="landscape"] .doc-header {
  grid-template-columns: 1.65fr 1fr;
  gap: 14px;
}

.memo-info-grid-land th {
  width: 7.5%;
  white-space: nowrap;
}

.memo-info-grid-land td {
  width: 25.8%;
}

.memo-land-split {
  display: grid;
  grid-template-columns: 0.96fr 1.24fr;
  gap: 9px;
  align-items: stretch;
}

.memo-land-split > .section-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.memo-land-details .memo-body-wrap {
  flex: 1;
  padding: 8px 10px;
  gap: 7px;
  justify-content: space-between;
}

.memo-land-attachments .table-footer-bar {
  margin-top: auto;
}

.check-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 12px;
  padding: 6px 10px;
  background: var(--accent-soft);
}

.bottom-signoff-group.memo-land-signoff {
  gap: 7px;
}

.memo-land-signoff .sig-box {
  min-height: 78px;
  padding: 5px 7px;
}

.memo-land-signoff .sig-line {
  height: 22px;
  margin: 3px 6px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.doc-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 8.5px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

/* ==========================================================================
   Print Styles (A4 Exact Output)
   ========================================================================== */
@page {
  size: A4 portrait;
  margin: 8mm 9mm;
  @top-left { content: none; }
  @top-center { content: none; }
  @top-right { content: none; }
  @bottom-left { content: none; }
  @bottom-center { content: none; }
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: "Sarabun", "Noto Sans Thai", sans-serif;
    font-size: 9pt;
    font-weight: 600;
    color: #52525b;
    padding: 0 4mm 2mm 0;
  }
}

@media print {
  html,
  body {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    -webkit-font-smoothing: auto !important;
    text-rendering: geometricPrecision !important;
  }

  * {
    -webkit-font-smoothing: auto !important;
    text-rendering: geometricPrecision !important;
  }

  [data-print-mirrored="1"] {
    display: none !important;
  }

  .docforms-print-mirror {
    display: block !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    overflow: visible !important;
    border-radius: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .workspace {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .pages-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .a4-sheet {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .a4-sheet[data-orientation="landscape"] {
    min-height: 0 !important;
  }

  .a4-sheet + .a4-sheet {
    break-before: page;
    page-break-before: always;
  }

  .logo-box:not(.has-logo),
  .logo-box:not(.has-logo) .logo-placeholder {
    visibility: hidden !important;
    border-color: transparent !important;
  }

  .inline-input,
  .cell-input,
  .cell-select,
  .area-input {
    border-color: transparent !important;
    background: transparent !important;
    appearance: none;
    -webkit-appearance: none;
  }

  .status-select {
    appearance: none;
    -webkit-appearance: none;
  }

  .area-input,
  .auto-wrap {
    resize: none;
    overflow: hidden;
  }

  thead {
    display: table-header-group;
  }

  tr,
  .important-callout,
  .notes-box,
  .bottom-signoff-group,
  .signature-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.pages-container.is-print-measuring [data-print-mirrored="1"] {
  display: none !important;
}

.pages-container.is-print-measuring .docforms-print-mirror {
  display: block !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  height: auto !important;
  min-height: 0 !important;
  border-color: transparent !important;
}

@media screen and (max-width: 840px) {
  .workspace {
    padding: 12px;
    overflow-x: auto;
    justify-content: flex-start;
  }
}
