:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
  font-size: 16px;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-light: #eff6ff;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #475569;
  --danger: #dc2626;
  --success: #16a34a;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  line-height: 1.5;
  background: #f8fafc;
  color: #0f172a;
}

a {
  color: var(--brand);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

button, select, input:not([type=file]):not([type=range]):not([type=color]):not([type=checkbox]):not([type=radio]) {
  min-height: 44px;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-weight: 550;
  transition: background-color 0.15s, border-color 0.15s;
}

button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-danger {
  color: var(--danger);
  border-color: #fca5a5;
  background: #fff5f5;
}

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #ef4444;
}

/* Header & Navigation (Standard 60px) */
.topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-inner {
  max-width: 1280px;
  margin: auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-weight: 750;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.nav-inner nav {
  display: flex;
  gap: 8px;
}

.nav-inner nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  min-height: 44px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-inner nav a.active, .nav-inner nav a:hover {
  color: var(--brand);
  text-decoration: none;
}

/* Main Container */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

main.nitro-main {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

h1 {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  font-weight: 750;
  line-height: 1.25;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.intro {
  margin: 0 0 16px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.security-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.security-banner svg {
  flex-shrink: 0;
}

/* Two-column layout */
.editor-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* Reflow intrinsic controls even when CSS layout zoom leaves media queries
   unchanged. Document stages keep their pixel dimensions inside local scroll. */
main { overflow-wrap: anywhere; }
.editor-layout > *, .panel-card, .field-group, .field-row > * {
  min-width: 0;
  max-width: 100%;
}
.editor-sidebar :is(button, select, textarea, input:not([type=file])) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Left Sidebar / Controls */
.editor-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.panel-card h2, .panel-card h3 {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0 0 10px 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: #eff6ff;
}

.dropzone svg {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.dropzone label {
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.dropzone input[type=file] {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
}

.dropzone-hint {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.sample-button-row {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.btn-sample {
  font-size: 0.85rem;
  padding: 8px 14px;
  min-height: 44px;
  background: #ffffff;
  border: 1px dashed #94a3b8;
  color: #334155;
}

.btn-sample:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Document Meta & Navigation */
.doc-info-panel {
  margin-top: 12px;
}

.doc-name-text {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-pages-text {
  color: var(--text-muted);
}

.doc-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.page-navigator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-btn {
  min-height: 44px;
  padding: 8px 14px;
}

.page-counter {
  font-weight: 600;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Tool Modes Grid */
.tool-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 80px), 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.tool-tab-btn {
  min-height: 44px;
  padding: 6px 8px;
  font-size: 0.825rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--text-muted);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.tool-tab-btn svg {
  width: 18px;
  height: 18px;
}

.tool-tab-btn.active {
  background: #eff6ff;
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

/* Tool Options Panel */
.tool-settings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.field-group label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-row input[type=text], .field-row select, .field-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}

.color-presets-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  padding: 0;
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--brand);
}

.color-picker-input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* History and Actions */
.history-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.history-actions-row button {
  flex: 1 1 calc(50% - 6px);
  min-height: 44px;
  font-size: 0.825rem;
}

/* Export Section */
.export-card {
  border-top: 2px solid var(--brand);
}

.export-quality-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.export-quality-row select {
  padding: 6px 10px;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.btn-export {
  width: 100%;
  min-height: 46px;
  font-size: 1rem;
}

.export-progress {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 20px;
  font-variant-numeric: tabular-nums;
}

.export-result-box {
  margin-top: 12px;
  padding: 16px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  overflow-wrap: anywhere;
}

.export-result-box p {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: #475569;
}

.export-result-box [hidden] { display: none !important; }

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

.btn-download:hover {
  background: #15803d;
  text-decoration: none;
}

/* Right Workbench & Canvas Viewport */
.editor-workbench {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workbench-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.toolbar-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.zoom-controls {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 4px;
}

.zoom-btn {
  min-height: 44px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.zoom-label {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: center;
}

/* PDF Viewport */
.pdf-viewport {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  background: #cbd5e1;
  border-radius: 6px;
  min-height: 520px;
  display: flex;
  align-items: flex-start;
  padding: 16px;
  position: relative;
  touch-action: pan-x pan-y;
}

.pdf-stage-wrapper {
  position: relative;
  flex: 0 0 auto;
  margin-inline: auto;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  background: #ffffff;
  user-select: none;
  -webkit-user-select: none;
}

.pdf-canvas-layer {
  display: block;
}

.pdf-overlay-layer {
  touch-action: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* Signature Modal / Dialog */
.signature-dialog {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.signature-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.dialog-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 650;
}

.dialog-body {
  padding: 16px;
}

.hint-no-margin {
  margin-top: 0;
}

.sig-pad-canvas {
  width: 100%;
  height: 180px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

.sig-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.sig-color-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sig-color-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.color-swatch-black {
  background: #0f172a;
}

.color-swatch-blue {
  background: #1d4ed8;
}

.btn-sig-clear {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.dialog-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Below the Fold Content */
.editor-documentation {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.feature-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 16px 0 28px 0;
}

.feature-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.feature-box h3 {
  font-size: 0.95rem;
  margin: 0 0 6px 0;
  font-weight: 650;
  color: var(--text-primary);
}

.feature-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FAQ Details */
.faq-section {
  margin-top: 24px;
}

.faq-section h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

details {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--text-primary);
}

details p {
  margin: 6px 0 12px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Footer */
footer {
  max-width: 1280px;
  margin: 40px auto 20px auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Tool Settings Auxiliary Classes */
.field-group-flex {
  flex: 1;
}

.field-group-mt {
  margin-top: 8px;
}

.field-group-mt-10 {
  margin-top: 10px;
}

.stamp-presets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-stamp-preset {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.btn-stamp-preset[data-text="LUNAS"] {
  color: #16a34a;
  border-color: #86efac;
  background: #f0fdf4;
}

.btn-stamp-preset[data-text="DISETUJUI"] {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}

.btn-stamp-preset[data-text="DRAFT"] {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.btn-quick-delete {
  min-height: 44px;
  padding: 6px 14px;
}

.btn-txt-bold, .btn-txt-italic {
  min-height: 44px;
  padding: 6px 14px;
}

.btn-open-sig {
  width: 100%;
  min-height: 44px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .topbar {
    height: 56px;
  }
  .nav-inner {
    padding: 0 12px;
  }
  .brand {
    font-size: 1.05rem;
  }
  main {
    padding: 12px;
  }
  .tool-modes-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 80px), 1fr));
  }
  .pdf-viewport {
    padding: 8px;
    min-height: 400px;
  }
}

/* Local header adaptation: keep brand and menu reachable, not clipped, at
   narrow effective widths. No global header or font-size changes. */
#siteHeader { container-type: inline-size; }
#siteHeader .site-header__brand { flex-shrink: 1; min-width: 0; }
#siteHeader .site-header__brand-text { white-space: normal; overflow-wrap: anywhere; }
#siteHeader .site-header__bar { min-width: 0; }
@container (max-width: 768px) {
  #siteHeader :is(.site-header__nav--desktop, .site-header__search--desktop, .site-header__cta--desktop) { display: none !important; }
  #siteHeader .site-header__toggle { display: inline-flex !important; }
  #siteHeader .site-header__drawer:not([hidden]) { display: block !important; }
  #siteHeader .site-header__search--mobile { display: block !important; }
  #siteHeader .site-header__nav-link--mobile { white-space: normal; overflow-wrap: anywhere; }
}
.editor-sidebar :is(.field-row, .color-presets-row, .doc-info-row) {
  flex-wrap: wrap;
  gap: 8px;
}
.editor-sidebar .doc-name-text { white-space: normal; overflow-wrap: anywhere; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Native PDF Object Inspection & Editing Layer */
.pdf-object-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pdf-object-layer[hidden] {
  display: none;
}

.pdf-native-box {
  position: absolute;
  margin: 0;
  padding: 0;
  min-height: 0;
  min-width: 0;
  border-radius: 3px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px dashed rgba(37, 99, 235, 0.65);
  pointer-events: auto;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

.pdf-native-box--image {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(5, 150, 105, 0.7);
}

.pdf-native-box:hover,
.pdf-native-box:focus-visible {
  background: rgba(37, 99, 235, 0.16);
  border-style: solid;
  border-color: #1d4ed8;
  z-index: 2;
}

.pdf-native-box--image:hover,
.pdf-native-box--image:focus-visible {
  background: rgba(16, 185, 129, 0.18);
  border-color: #047857;
}

.pdf-native-box--replaced {
  background: rgba(217, 119, 6, 0.14);
  border: 2px solid #d97706;
}

.pdf-native-box--deleted {
  background: rgba(220, 38, 38, 0.14);
  border: 2px dashed #dc2626;
}

.pdf-native-box--selected {
  border-style: solid;
  border-width: 1.5px;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.28);
  z-index: 3;
}

.pdf-native-box--image.pdf-native-box--selected {
  border-color: #047857;
  box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.28);
}

.pdf-native-box--selected::before,
.pdf-native-box--selected::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 1.5px solid #2563eb;
  border-radius: 1.5px;
  pointer-events: none;
}

.pdf-native-box--selected::before {
  top: -4px;
  left: -4px;
}

.pdf-native-box--selected::after {
  bottom: -4px;
  right: -4px;
}

.pdf-native-box--image.pdf-native-box--selected::before,
.pdf-native-box--image.pdf-native-box--selected::after {
  border-color: #047857;
}

.pdf-object-layer.pdf-object-layer--inactive .pdf-native-box {
  pointer-events: none;
  opacity: 0.4;
}

/* Native Edit Sidebar Card & Operations List */
.native-edit-card {
  border-top: 2px solid #0f172a;
}

.native-edit-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.native-edit-header h2 {
  margin: 0;
}

.native-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 44px;
}

.native-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

.native-status-text {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.native-ops-container {
  margin-bottom: 10px;
}

.native-ops-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.btn-compact {
  min-height: 44px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.native-ops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.native-ops-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.825rem;
  min-width: 0;
}

.native-ops-item-text {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

.native-ops-item .btn-compact {
  flex: 0 0 auto;
}

/* Native Object Modal Controls */
.native-orig-preview {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  max-height: 90px;
  overflow-y: auto;
}

.native-text-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  font-size: 1rem;
  min-height: 44px;
}

.native-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.native-dialog-actions button {
  flex: 1 1 auto;
}

.native-image-preview-wrap {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
  text-align: center;
}

.native-image-preview {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}

.native-dialog-error {
  margin: 10px 0 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.85rem;
}

#native-image-input {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 768px) {
  input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]),
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .signature-dialog {
    width: calc(100vw - 24px);
    max-width: 480px;
  }
}

/* ==========================================================================
   NITRO PDF 4-ZONE WORKSPACE LAYOUT
   ========================================================================== */
.nitro-main .editor-documentation {
  max-width: 1280px;
  margin: 28px auto 0;
  padding: 24px 16px 0;
}

.nitro-workspace-app {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #f8fafc;
}

/* ==========================================================================
   ZONA 2: TOP RIBBON TOOLBAR (PRESISI DESKTOP-GRADE & ZERO-OVERFLOW WRAPPING)
   ========================================================================== */

.nitro-ribbon {
  position: sticky;
  top: 60px; /* Tepat di bawah Site Header 60px */
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 6px 16px;
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
}

/* Row Containers */
.nitro-ribbon-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.nitro-ribbon-row-top {
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
  flex-wrap: nowrap;
}

.nitro-ribbon-row-bottom {
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Functional Groups */
.ribbon-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}

.ribbon-group-nav,
.ribbon-group-actions,
.ribbon-group-native,
.ribbon-group-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.ribbon-subgroup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Dividers (Hanya di dalam cluster/grup internal) */
.ribbon-divider {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

/* Standarisasi 44px Universal Touch & Centerline Axis */
.ribbon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 550;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ribbon-btn-text {
  padding: 6px 12px;
}

.ribbon-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.ribbon-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.ribbon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Input Lompat Halaman Presisi */
.page-jump-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  flex-shrink: 0;
}

.page-jump-input {
  width: 52px;
  height: 44px;
  min-height: 44px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  background: #ffffff;
  box-sizing: border-box;
  line-height: 1;
}

.page-jump-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.page-total-label,
.zoom-indicator,
#page-indicator,
#zoom-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  padding: 0 4px;
  box-sizing: border-box;
}

/* Mode Objek Bawaan: Toggle, Chip & Reset */
.ribbon-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 6px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 550;
  color: #334155;
  cursor: pointer;
  box-sizing: border-box;
}

.ribbon-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  margin: 0;
  cursor: pointer;
}

.native-ops-chip,
#native-ops-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 9999px;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  align-self: center;
  box-sizing: border-box;
  line-height: 1;
}

.ribbon-btn-chip-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  align-self: center;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ribbon-btn-chip-reset:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.ribbon-btn-chip-reset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 7 Alat Anotasi Harmonis (tool-tab-btn identik untuk seluruh alat termasuk btn-quick-sig) */
.nitro-ribbon .tool-tab-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 550;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nitro-ribbon .tool-tab-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nitro-ribbon .tool-tab-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.nitro-ribbon .tool-tab-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

/* Tombol Aksi Dokumen */
.ribbon-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  height: 44px;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.ribbon-btn-apply {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.ribbon-btn-apply:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.ribbon-btn-export {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.ribbon-btn-export:hover:not(:disabled) {
  background: #1e293b;
  border-color: #1e293b;
}

.ribbon-btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Teks Pendukung Responsif */
.label-short,
.btn-text-short,
.chip-short {
  display: none;
}

/* ==========================================================================
   PENATAAN RESPONSIF & ZERO-OVERFLOW DI 768px, 390px, 360px
   ========================================================================== */

/* Tablet (768px - 960px): Tepat 2 Baris Bersih Rapat */
@media (max-width: 960px) {
  .nitro-ribbon {
    padding: 4px 12px;
    gap: 2px;
    min-height: auto;
  }

  .label-full,
  .btn-text-full,
  .chip-full {
    display: none;
  }

  .label-short,
  .btn-text-short,
  .chip-short {
    display: inline;
  }

  .nitro-ribbon .tool-tab-btn {
    padding: 6px 8px;
    gap: 4px;
  }

  .ribbon-group {
    gap: 4px;
  }

  .nitro-ribbon-row-top {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 4px;
  }

  .nitro-ribbon-row-top::-webkit-scrollbar {
    display: none;
  }

  .nitro-ribbon-row-bottom {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
  }

  .nitro-ribbon-row-bottom::-webkit-scrollbar {
    display: none;
  }
}

/* Mobile Standard & Mini (<= 600px): Touch-Scroll Ramping Anti-Wrap Liar */
@media (max-width: 600px) {
  .nitro-ribbon {
    position: static;
    padding: 4px 8px;
    gap: 2px;
    min-height: auto;
  }

  /* Baris 1: Navigasi & Aksi Touch Strip */
  .nitro-ribbon-row-top {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 6px;
  }

  .nitro-ribbon-row-top::-webkit-scrollbar {
    display: none;
  }

  /* Baris 2: 7 Tools Touch Strip */
  .nitro-ribbon-row-bottom {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }

  .nitro-ribbon-row-bottom::-webkit-scrollbar {
    display: none;
  }

  .nitro-ribbon .tool-tab-btn {
    min-width: 44px;
    padding: 6px 10px;
    flex-shrink: 0;
  }

  .ribbon-divider {
    display: inline-block;
    height: 20px;
    margin: 0 2px;
  }
}

/* Layar Ekstrem Sempit (<= 390px): Teks Tool Disembunyikan (Icon-Only 44x44px) */
@media (max-width: 390px) {
  .nitro-ribbon .tool-tab-btn span {
    display: none;
  }

  .nitro-ribbon .tool-tab-btn {
    min-width: 44px;
    width: 44px;
    padding: 6px;
    justify-content: center;
  }

  .page-jump-input {
    width: 42px;
  }
}

/* Zona 3: 3-Pane Workspace Body */
.nitro-workspace-body {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: calc(100vh - 114px);
  background: #f8fafc;
}

/* Pane A: Left Thumbnail Sidebar */
.nitro-sidebar-left {
  width: 200px;
  flex: 0 0 200px;
  position: sticky;
  top: 114px;
  height: calc(100vh - 114px);
  background: #ffffff;
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

.nitro-sidebar-left.collapsed {
  display: none;
}

.sidebar-header {
  height: 44px;
  flex-shrink: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
}

.thumbnail-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumbnail-list:empty::before {
  content: "Halaman PDF akan tampil di sini.";
  font-size: 0.825rem;
  color: #475569;
  text-align: center;
  padding: 24px 8px;
}

.thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.thumb-item:hover {
  background: #f1f5f9;
}

.thumb-item.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

.thumb-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.thumb-item.active .thumb-number {
  color: #2563eb;
  font-weight: 700;
}

.thumb-preview-wrap {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Pane B: Center Document Stage */
.nitro-stage-center {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.stage-intro-bar {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.stage-intro-bar .breadcrumb {
  margin-bottom: 4px;
}

.stage-intro-bar h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  margin: 0 0 4px 0;
}

.stage-intro-bar .intro {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
}

.stage-intro-bar .security-banner {
  margin-bottom: 0;
}

.doc-meta-strip {
  min-height: 40px;
  padding: 6px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: #475569;
}

.doc-meta-strip[hidden] {
  display: none !important;
}

.nitro-stage-center .pdf-viewport {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  background: #e2e8f0;
  border-radius: 0;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
}

.nitro-stage-center .pdf-stage-wrapper {
  border: 1px solid #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.08);
  scroll-margin-top: 132px;
}

.nitro-stage-center .pdf-overlay-layer {
  scroll-margin-top: 132px;
}

.nitro-stage-center:has(#doc-info[hidden]) #pdf-stage {
  display: none;
}

.dropzone-centered {
  width: 100%;
  max-width: 460px;
  margin: auto;
  background: #ffffff;
  padding: 24px 16px;
  gap: 10px;
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nitro-stage-center:has(#doc-info:not([hidden])) .dropzone-centered {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  margin: 0;
  padding: 8px 14px;
  text-align: left;
}

.nitro-stage-center:has(#doc-info:not([hidden])) .dropzone-centered .dropzone-icon {
  display: none;
}

.nitro-stage-center:has(#doc-info:not([hidden])) .dropzone-centered .dropzone-copy {
  align-items: flex-start;
}

.nitro-stage-center:has(#doc-info:not([hidden])) .dropzone-centered .sample-button-row {
  margin-top: 0;
}

/* Pane C: Right Contextual Inspector Panel */
.nitro-inspector-right {
  width: 300px;
  flex: 0 0 300px;
  min-width: 0;
  position: sticky;
  top: 114px;
  max-height: calc(100vh - 114px);
  overflow-y: auto;
  background: #ffffff;
  border-left: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.inspector-header {
  min-height: 44px;
  flex-shrink: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.inspector-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
}

.inspector-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.inspector-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-heading {
  font-size: 0.825rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.inspector-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.inspector-actions-row button {
  flex: 1 1 calc(50% - 4px);
  font-size: 0.85rem;
}

.inspector-body .native-edit-card,
.inspector-body .export-card {
  border-top: 0;
}

.inspector-body :is(button, select, textarea, input:not([type=file]), .export-quality-row, .field-row, .color-presets-row) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.inspector-body :is(button, select, textarea, input:not([type=file])) {
  white-space: normal;
}

.inspector-body :is(.field-row, .color-presets-row) {
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 1025px) {
  html:has(#nitro-ribbon) {
    scroll-padding-block: 126px 12px;
  }
}

@container (max-width: 960px) {
  .nitro-ribbon {
    position: static;
    padding: 4px 12px;
    gap: 2px;
    min-height: auto;
  }
  .label-full,
  .btn-text-full,
  .chip-full {
    display: none;
  }
  .label-short,
  .btn-text-short,
  .chip-short {
    display: inline;
  }
  .nitro-ribbon .tool-tab-btn {
    padding: 6px 8px;
    gap: 4px;
  }
  .ribbon-group {
    gap: 4px;
  }
  .nitro-ribbon-row-top {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 4px;
  }
  .nitro-ribbon-row-top::-webkit-scrollbar {
    display: none;
  }
  .nitro-ribbon-row-bottom {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
  }
  .nitro-ribbon-row-bottom::-webkit-scrollbar {
    display: none;
  }
  .nitro-sidebar-left {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    height: auto;
    width: min(240px, 85vw);
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    z-index: 45;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease;
  }
  .nitro-sidebar-left.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nitro-inspector-right {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@container (max-width: 600px) {
  .nitro-workspace-body {
    flex-direction: column;
    min-height: auto;
  }
  .nitro-stage-center {
    width: 100%;
    flex: none;
  }
  .nitro-stage-center .pdf-viewport {
    min-height: 260px;
    padding: 16px;
  }
  .nitro-inspector-right {
    width: 100%;
    flex: none;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }
  .inspector-body {
    padding: 16px 24px;
  }
}

@media (max-width: 1024px) {
  .nitro-ribbon {
    position: static;
  }
  .nitro-sidebar-left {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    height: auto;
    width: min(240px, 85vw);
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    z-index: 45;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease;
  }
  .nitro-sidebar-left.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nitro-inspector-right {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 900px) {
  .nitro-workspace-body {
    flex-direction: column;
    min-height: auto;
  }
  .nitro-stage-center {
    width: 100%;
    flex: none;
  }
  .nitro-stage-center .pdf-viewport {
    min-height: 260px;
    padding: 16px;
  }
  .nitro-inspector-right {
    width: 100%;
    flex: none;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }
  .inspector-body {
    padding: 16px 24px;
  }
}
