/* Right Preview Column (Sticky on Desktop) */
.preview-column {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 1040px) {
  .preview-column {
    position: static;
  }
}

/* Preview Actions Toolbar */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  gap: 12px;
  flex-wrap: wrap;
}
.preview-toolbar-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pdf-save-hint {
  flex-basis: 100%;
  margin: -2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: 0;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(82, 101, 232, .25);
  transition: all .15s;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: toastFadeIn .2s ease-out;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* A4 Paper Canvas Container */
.paper-container {
  background: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.05);
}
@media (max-width: 640px) {
  .paper-container {
    padding: 12px;
  }
}

/* A4 Paper Sheet */
.a4-sheet {
  background: white;
  width: 100%;
  max-width: 680px;
  min-height: 880px;
  padding: 48px 44px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  color: #111827;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.85;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (max-width: 640px) {
  .a4-sheet {
    padding: 28px 20px;
    font-size: 13px;
    min-height: auto;
  }
}

/* Document Typography */
.doc-title {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .15em;
  margin: 0 0 24px;
  color: #000;
  padding-bottom: 16px;
  border-bottom: 2px solid #111;
  font-family: var(--font-serif);
}

.doc-subtitle {
  text-align: center;
  font-size: 13px;
  color: #4b5563;
  margin: -16px 0 20px;
  font-family: var(--font-sans);
}

.doc-parties {
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.7;
}
.doc-party-row {
  margin-bottom: 6px;
}
.doc-party-role {
  font-weight: 800;
  color: #000;
}

.doc-preamble {
  margin: 18px 0;
  text-indent: 1em;
  text-align: justify;
}

/* Numbered Articles (제1조, 제2조 등) */
.doc-articles {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}
.doc-article {
  text-align: justify;
}
.doc-article-title {
  font-weight: 800;
  color: #000;
  margin-bottom: 4px;
}
.doc-article-body {
  margin: 0;
  text-indent: 1em;
}
.doc-clause-list {
  margin: 6px 0 0 1.2em;
  padding: 0;
  list-style-type: decimal;
}
.doc-clause-item {
  margin-bottom: 4px;
}

/* Exhibits / Tables */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  font-family: var(--font-sans);
}
.doc-table th, .doc-table td {
  border: 1px solid #374151;
  padding: 8px 10px;
  text-align: left;
}
.doc-table th {
  background: #f3f4f6;
  font-weight: 700;
  color: #111827;
}

/* Document Date & Signatures */
.doc-date {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 36px 0 32px;
}

.doc-signatures {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.doc-sig-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #9ca3af;
}
.doc-sig-label {
  font-weight: 700;
}
.doc-sig-name-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.doc-seal-circle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-sans);
}

/* Document Disclaimers / Legal Safeguard Note */
.doc-footer-disclaimer {
  margin-top: 36px;
  padding-top: 12px;
  border-top: 1px solid #d1d5db;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
  font-family: var(--font-sans);
}
