/* Trigger button */
.ldf-edit-document-btn {
	width: 100%;
	padding: 14px 20px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 500;
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
	transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.ldf-edit-document-btn:hover {
	background: #1d4ed8;
	box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.25);
}

.ldf-edit-document-btn:active {
	transform: translateY(1px);
}

/* Hide the inline form/preview until "Edit Document" is clicked.
   Use a descendant selector so page-builder wrappers don't break it. */
.ldf-inline-wrapper .ldf-container {
	display: none !important;
}

/* Loading state while the editor is fetched via AJAX. */
.ldf-is-loading .ldf-loading-message {
	padding: 24px 20px;
	text-align: center;
	color: #64748b;
	font-size: 15px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
}

/* Modal shell */
.ldf-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
}

.ldf-modal.active {
	display: flex;
}

.ldf-modal.active .ldf-modal-backdrop {
	animation: ldf-backdrop-in 0.25s ease;
}

.ldf-modal.active .ldf-modal-content {
	animation: ldf-modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ldf-backdrop-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ldf-modal-in {
	from {
		opacity: 0;
		transform: translateY(-12px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.ldf-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.ldf-modal-content {
	position: relative;
	background: #fff;
	width: 98%;
	max-width: 1440px;
	height: 98vh;
	max-height: 98vh;
	border-radius: 18px;
	box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Modal header */
.ldf-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 24px;
	background: #fff;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.ldf-modal-title {
	display: flex;
	align-items: center;
	gap: 14px;
}

.ldf-modal-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: #eff6ff;
	color: #2563eb;
	border-radius: 12px;
}

.ldf-modal-header .ldf-modal-title-text {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	color: #0f172a;
}

.ldf-modal-tagline {
	margin: 2px 0 0;
	font-size: 0.8rem;
	color: #64748b;
}

.ldf-modal-controls {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ldf-modal-controls button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ldf-preview-toggle-btn,
.ldf-download-btn-top {
	background: #fff;
	color: #475569;
	border: 1px solid #e2e8f0;
}

.ldf-preview-toggle-btn:hover,
.ldf-download-btn-top:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
	color: #0f172a;
}

.ldf-save-close-btn {
	background: #2563eb;
	color: #fff;
	border: 1px solid #2563eb;
}

.ldf-save-close-btn:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.ldf-save-close-btn:disabled,
.ldf-download-btn-top:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.ldf-modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	padding: 0;
	color: #475569;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ldf-modal-close:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #0f172a;
}

.ldf-modal-close:active {
	transform: scale(0.95);
}

/* Modal body layout */
.ldf-modal-body {
	padding: 0;
	overflow: hidden;
	flex: 1 1 auto;
	min-height: 0;
	background: #f8fafc;
}

.ldf-edit-modal .ldf-modal-body > .ldf-container {
	display: grid !important;
	grid-template-columns: 220px minmax(0, 0.85fr) minmax(0, 1.55fr);
	grid-template-rows: 1fr;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

.ldf-container.ldf-preview-collapsed {
	grid-template-columns: 220px minmax(0, 1fr) !important;
}

.ldf-container.ldf-preview-collapsed .ldf-preview-panel {
	display: none;
}

/* Full preview overlay */
.ldf-full-preview {
	display: none;
	position: absolute;
	inset: 0;
	background: #fff;
	z-index: 50;
	flex-direction: column;
	border-radius: 18px;
	overflow: hidden;
}

.ldf-full-preview.is-open {
	display: flex;
}

.ldf-full-preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 24px;
	background: #fff;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.ldf-full-preview-header .ldf-full-preview-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #0f172a;
}

.ldf-full-preview-header p {
	margin: 4px 0 0;
	font-size: 0.8rem;
	color: #64748b;
}

.ldf-full-preview-tools {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ldf-full-preview-tools button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	color: #475569;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ldf-full-preview-tools button:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
	color: #0f172a;
}

.ldf-full-preview-download,
.ldf-full-preview-print {
	width: 38px;
	height: 38px;
	padding: 0;
}

.ldf-full-preview-close {
	padding: 9px 16px;
	font-size: 0.85rem;
	font-weight: 500;
}

.ldf-full-preview-body {
	flex: 1 1 auto;
	overflow: auto;
	padding: 24px;
	background: #f8fafc;
}

.ldf-full-preview-body .ldf-document {
	max-width: 850px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 48px 56px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ldf-final-preview .ldf-preview-field {
	color: inherit;
	border-bottom: none;
	font-weight: normal;
	padding: 0;
	background: transparent;
	border-radius: 0;
}

/* Sidebar steps */
.ldf-step-sidebar,
.ldf-form-panel,
.ldf-preview-panel {
	min-height: 0;
}

.ldf-step-sidebar {
	background: #f8fafc;
	border-right: 1px solid #e2e8f0;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 16px;
	overflow-y: auto;
}

.ldf-steps {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ldf-step {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 10px 12px;
	cursor: pointer;
	color: #475569;
	font-size: 0.9rem;
	font-weight: 500;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ldf-step:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
}

.ldf-step.is-active {
	background: #eff6ff;
	color: #2563eb;
	border-color: #bfdbfe;
	box-shadow: 0 0 0 1px #bfdbfe, 0 2px 4px rgba(37, 99, 235, 0.08);
}

.ldf-step.is-active .ldf-step-number {
	background: #2563eb;
	color: #fff;
}

.ldf-step.is-completed .ldf-step-number {
	background: #dcfce7;
	color: #166534;
}

.ldf-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: #e2e8f0;
	color: #64748b;
	border-radius: 50%;
	font-size: 0.8rem;
	font-weight: 700;
	flex-shrink: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

.ldf-progress-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px;
}

.ldf-progress-title {
	font-size: 0.85rem;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 4px;
}

.ldf-progress-text,
.ldf-progress-percent {
	font-size: 0.75rem;
	color: #64748b;
}

.ldf-progress-bar {
	height: 6px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	margin: 10px 0 6px;
}

.ldf-progress-fill {
	display: block;
	height: 100%;
	width: 0;
	background: #2563eb;
	border-radius: 999px;
	transition: width 0.3s ease;
}

/* Form panel */
.ldf-form-panel {
	background: #fff;
	border-right: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ldf-form {
	padding: 24px;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
}

.ldf-section {
	padding: 8px 0 24px;
}

.ldf-section + .ldf-section {
	border-top: 1px solid #e2e8f0;
	padding-top: 24px;
}

.ldf-section-title {
	margin: 0 0 20px;
	font-size: 1.2rem;
	font-weight: 700;
	color: #0f172a;
}

.ldf-form-scroll-hint {
	display: none;
	justify-content: center;
	align-items: center;
	gap: 6px;
	padding: 10px 24px;
	font-size: 0.8rem;
	font-weight: 500;
	color: #475569;
	background: #f8fafc;
	flex-shrink: 0;
}

.ldf-form-scroll-hint.is-visible {
	display: flex;
}

.ldf-form-scroll-hint svg {
	flex-shrink: 0;
}

.ldf-form-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 16px 24px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.ldf-form-actions-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ldf-reset-btn,
.ldf-prev-btn,
.ldf-next-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 11px 18px;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.ldf-reset-btn,
.ldf-prev-btn {
	background: #fff;
	color: #475569;
	border: 1px solid #e2e8f0;
}

.ldf-reset-btn:hover,
.ldf-prev-btn:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
}

.ldf-prev-btn {
	visibility: hidden;
}

.ldf-next-btn {
	background: #2563eb;
	color: #fff;
	border: 1px solid #2563eb;
}

.ldf-next-btn:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.ldf-next-btn:active {
	transform: translateY(1px);
}

/* Preview panel */
.ldf-preview-panel {
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ldf-preview-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 18px;
	background: #fff;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.ldf-preview-zoom {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ldf-preview-zoom button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	color: #475569;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ldf-preview-zoom button:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
}

.ldf-preview-zoom .ldf-zoom-level {
	font-size: 0.8rem;
	min-width: 44px;
	text-align: center;
	color: #64748b;
}

.ldf-highlight-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8rem;
	color: #475569;
	cursor: pointer;
	user-select: none;
}

.ldf-highlight-toggle input {
	margin: 0;
}

.ldf-preview-scroll {
	flex: 1 1 auto;
	overflow: auto;
	padding: 24px;
	min-height: 0;
}

.ldf-preview {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 32px;
	min-height: 400px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ldf-pdf-preview {
	display: none;
	height: 100%;
	background: #fff;
}

.ldf-pdf-preview iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* Document preview text */
.ldf-preview .ldf-document p {
	margin: 0 0 0.6em 0;
	white-space: pre-wrap;
}

.ldf-preview-field {
	color: #64748b;
	font-weight: 500;
	border-bottom: 1px dashed #94a3b8;
	padding: 0 2px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ldf-highlight-on .ldf-preview-field {
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	padding: 2px 8px;
	border-bottom: none;
	cursor: pointer;
}

.ldf-highlight-on .ldf-preview-field:hover {
	background: #dbeafe;
	border-color: #93c5fd;
}

.ldf-preview-field.ldf-has-image {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
}

.ldf-highlight-on .ldf-preview-field.ldf-has-image,
.ldf-highlight-on .ldf-preview-field.ldf-has-image:hover {
	background: transparent;
	border: none;
	padding: 0;
}

.ldf-preview-field.ldf-has-image img {
	max-width: 150px;
	height: auto;
	vertical-align: middle;
}

.ldf-preview-field.ldf-has-image img.ldf-initials-image {
	max-width: 70px;
}

.ldf-final-preview .ldf-preview-field.ldf-has-image img {
	max-width: 120px;
}

/* Fields */
.ldf-field {
	margin-bottom: 20px;
}

.ldf-field label {
	display: block;
	font-weight: 600;
	font-size: 0.88rem;
	color: #334155;
	margin-bottom: 6px;
}

.ldf-field input,
.ldf-field textarea,
.ldf-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 0.9rem;
	color: #0f172a;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ldf-field input[type="date"]::-webkit-calendar-picker-indicator {
	opacity: 1;
	cursor: pointer;
}

.ldf-field input:focus,
.ldf-field textarea:focus,
.ldf-field select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ldf-required {
	color: #ef4444;
}

.ldf-choice {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	margin: 8px 0;
	font-size: 0.9rem;
	color: #334155;
}

.ldf-choice input {
	width: auto;
	margin: 0;
}

/* Signature / Initials */
.ldf-canvas-wrapper {
	border: 1px solid #d1d5db;
	background: #fff;
	border-radius: 8px;
	padding: 6px;
}

.ldf-signature-pad,
.ldf-initials-pad {
	display: block;
	width: 100%;
	cursor: crosshair;
	touch-action: none;
}

.ldf-signature-pad {
	max-width: 400px;
}

.ldf-initials-pad {
	max-width: 200px;
}

.ldf-clear-canvas {
	margin-top: 6px;
	font-size: 0.75rem;
	padding: 5px 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	color: #475569;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ldf-clear-canvas:hover {
	background: #f1f5f9;
}

/* Legacy fallback button (not used in new modal but kept safe) */
.ldf-download-btn {
	width: 100%;
	padding: 12px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	margin-top: 8px;
}

.ldf-download-btn:disabled {
	background: #a7aaad;
	cursor: not-allowed;
}

/* Save & Close confirmation dialog */
.ldf-save-close-dialog {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 60;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.ldf-save-close-dialog.is-open {
	display: flex;
}

.ldf-save-close-card {
	position: relative;
	width: 92%;
	max-width: 420px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	padding: 36px 32px 28px;
	text-align: center;
	box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18);
}

.ldf-save-close-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: #475569;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ldf-save-close-close:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #0f172a;
}

.ldf-save-close-icon {
	width: 64px;
	height: 64px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f0fdf4;
	border-radius: 50%;
	margin-bottom: 18px;
}

.ldf-save-close-icon svg {
	display: block;
}

.ldf-save-close-card .ldf-save-close-title {
	margin: 0 0 10px;
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.ldf-save-close-card p {
	margin: 0 0 6px;
	font-size: 0.9rem;
	color: #64748b;
	line-height: 1.5;
}

.ldf-save-close-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 16px;
}

.ldf-save-close-actions button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1 1 50%;
	padding: 11px 18px;
	border-radius: 10px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ldf-download-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
	text-align: left;
}

.ldf-download-option {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

.ldf-download-option:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
}

.ldf-download-option:active {
	transform: translateY(1px);
}

.ldf-download-option-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ldf-download-option-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.ldf-download-option-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.ldf-download-option-title {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
	color: #0f172a;
}

.ldf-download-option-desc {
	display: block;
	font-size: 0.8rem;
	color: #64748b;
}

.ldf-download-option-arrow {
	flex-shrink: 0;
	color: #94a3b8;
	transition: color 0.15s ease;
}

.ldf-download-option:hover .ldf-download-option-arrow {
	color: #475569;
}

.ldf-save-close-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 6px;
	color: #94a3b8;
	font-size: 0.85rem;
	font-weight: 500;
}

.ldf-save-close-or::before,
.ldf-save-close-or::after {
	content: '';
	flex: 1 1 auto;
	height: 1px;
	background: #e2e8f0;
}

.ldf-save-close-continue {
	background: #fff;
	color: #334155;
	border: 1px solid #d1d5db;
}

.ldf-save-close-continue:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.ldf-save-close-closebtn {
	background: #2563eb;
	color: #fff;
	border: 1px solid #2563eb;
}

.ldf-save-close-closebtn:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.ldf-save-close-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 22px;
	padding: 12px 14px;
	background: #eff6ff;
	border-radius: 10px;
	font-size: 0.8rem;
	color: #475569;
	text-align: left;
	line-height: 1.45;
}

.ldf-save-close-note svg {
	flex-shrink: 0;
	margin-top: 1px;
	color: #2563eb;
}

/* Download format dialog */
.ldf-download-dialog {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 60;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.ldf-download-dialog.is-open {
	display: flex;
}

.ldf-download-card {
	position: relative;
	width: 92%;
	max-width: 420px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	padding: 36px 32px 28px;
	text-align: center;
	box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18);
}

.ldf-download-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: #475569;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ldf-download-close:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #0f172a;
}

.ldf-download-icon {
	width: 64px;
	height: 64px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #eff6ff;
	border-radius: 50%;
	margin-bottom: 18px;
}

.ldf-download-icon svg {
	display: block;
}

.ldf-download-card .ldf-download-title {
	margin: 0 0 10px;
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.ldf-download-card p {
	margin: 0 0 6px;
	font-size: 0.9rem;
	color: #64748b;
	line-height: 1.5;
}

.ldf-download-actions {
	display: flex;
	justify-content: center;
	margin-top: 16px;
}

.ldf-download-cancel {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 24px;
	border-radius: 10px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	background: #fff;
	color: #334155;
	border: 1px solid #d1d5db;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ldf-download-cancel:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.ldf-download-cancel:active {
	transform: translateY(1px);
}

.ldf-download-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 22px;
	padding: 12px 14px;
	background: #eff6ff;
	border-radius: 10px;
	font-size: 0.8rem;
	color: #475569;
	text-align: left;
	line-height: 1.45;
}

.ldf-download-note svg {
	flex-shrink: 0;
	margin-top: 1px;
	color: #2563eb;
}

/* Reset confirmation dialog */
.ldf-reset-dialog {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 60;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.ldf-reset-dialog.is-open {
	display: flex;
}

.ldf-reset-card {
	position: relative;
	width: 92%;
	max-width: 400px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	padding: 36px 32px 28px;
	text-align: center;
	box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18);
}

.ldf-reset-icon {
	width: 64px;
	height: 64px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff7ed;
	border-radius: 50%;
	margin-bottom: 18px;
}

.ldf-reset-icon svg {
	display: block;
}

.ldf-reset-title {
	margin: 0 0 10px;
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.ldf-reset-message {
	margin: 0 0 24px;
	font-size: 0.9rem;
	color: #64748b;
	line-height: 1.5;
}

.ldf-reset-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
}

.ldf-reset-actions button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	border-radius: 10px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ldf-reset-cancel {
	background: #fff;
	color: #334155;
	border: 1px solid #d1d5db;
}

.ldf-reset-cancel:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.ldf-reset-confirm {
	background: #dc2626;
	color: #fff;
	border: 1px solid #dc2626;
}

.ldf-reset-confirm:hover {
	background: #b91c1c;
	border-color: #b91c1c;
}

.ldf-reset-toast {
	display: none;
	position: absolute;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	z-index: 70;
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	font-size: 0.85rem;
	font-weight: 500;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
	white-space: nowrap;
}

.ldf-reset-toast.is-open {
	display: inline-flex;
}

.ldf-reset-toast svg {
	flex-shrink: 0;
}

/* Mobile-only / desktop-only toggles */
.ldf-mobile-tabs,
.ldf-modal-tagline-mobile {
	display: none;
}

.ldf-progress-card-mobile {
	display: none;
}

/* Responsive */
@media (max-width: 900px) {
	.ldf-edit-modal .ldf-modal-body > .ldf-container {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr 1fr;
		overflow-y: auto;
	}

	.ldf-container.ldf-preview-collapsed {
		grid-template-columns: 1fr !important;
	}

	.ldf-step-sidebar {
		border-right: none;
		border-bottom: 1px solid #e2e8f0;
		padding: 12px;
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
	}

	.ldf-steps {
		flex-direction: row;
		gap: 8px;
	}

	.ldf-step {
		white-space: nowrap;
	}

	.ldf-progress-card {
		display: none;
	}

	.ldf-form-panel {
		border-right: none;
		border-bottom: 1px solid #e2e8f0;
	}

	.ldf-preview-panel {
		min-height: 300px;
	}
}

/* Mobile (< 768px) tabbed layout */
@media (max-width: 767px) {
	.ldf-edit-modal .ldf-modal-content {
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.ldf-modal-header {
		padding: 12px 16px;
		gap: 12px;
		flex-wrap: wrap;
	}

	.ldf-modal-title {
		gap: 10px;
		flex-wrap: wrap;
		flex: 1 1 auto;
		min-width: 0;
	}

	.ldf-modal-icon {
		width: 34px;
		height: 34px;
	}

	.ldf-modal-icon svg {
		width: 20px;
		height: 20px;
	}

	.ldf-modal-header .ldf-modal-title-text {
		font-size: 0.9rem;
	}

	.ldf-modal-tagline {
		font-size: 0.72rem;
	}

	.ldf-modal-tagline-desktop {
		display: none;
	}

	.ldf-modal-tagline-mobile {
		display: block;
	}

	.ldf-modal-controls {
		gap: 8px;
		flex-wrap: wrap;
		justify-content: flex-end;
		margin-left: auto;
	}

	.ldf-modal-controls .ldf-preview-toggle-btn {
		display: none;
	}

	.ldf-mobile-tabs {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		padding: 4px;
		background: #f1f5f9;
		border-radius: 8px;
	}

	.ldf-mobile-tab {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 7px 14px;
		border: none;
		border-radius: 6px;
		background: transparent;
		color: #475569;
		font-size: 0.82rem;
		font-weight: 600;
		cursor: pointer;
		transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
	}

	.ldf-mobile-tab:hover {
		color: #2563eb;
	}

	.ldf-mobile-tab.is-active {
		background: #fff;
		color: #2563eb;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	}

	.ldf-download-btn-top,
	.ldf-save-close-btn {
		padding: 7px 12px;
		font-size: 0.8rem;
	}

	.ldf-modal-close {
		width: 32px;
		height: 32px;
		font-size: 20px;
	}

	.ldf-edit-modal .ldf-modal-body > .ldf-container {
		display: flex !important;
		flex-direction: column;
		height: 100%;
		overflow: hidden;
	}

	.ldf-step-sidebar {
		flex: 0 0 auto;
		flex-direction: row;
		gap: 8px;
		padding: 12px 16px;
		border-right: none;
		border-bottom: 1px solid #e2e8f0;
		background: #fff;
	}

	.ldf-steps {
		flex-direction: row;
		gap: 6px;
		width: 100%;
	}

	.ldf-step {
		white-space: nowrap;
		padding: 7px 10px;
		font-size: 0.78rem;
	}

	.ldf-step-number {
		width: 22px;
		height: 22px;
		font-size: 0.7rem;
	}

	.ldf-progress-card {
		display: none;
	}

	.ldf-progress-card-mobile {
		display: block;
		margin: 0 16px;
		padding: 12px;
	}

	.ldf-form-panel,
	.ldf-preview-panel {
		display: none;
		flex: 1 1 auto;
		min-height: 0;
	}

	.ldf-container.ldf-mobile-view-form .ldf-form-panel,
	.ldf-container.ldf-mobile-view-preview .ldf-preview-panel {
		display: flex;
	}

	.ldf-container.ldf-mobile-view-form .ldf-step-sidebar {
		display: flex;
	}

	.ldf-container.ldf-mobile-view-preview .ldf-step-sidebar {
		display: none;
	}

	.ldf-form-panel {
		border-right: none;
	}

	.ldf-form {
		padding: 16px;
	}

	.ldf-section {
		padding: 0 0 20px;
	}

	.ldf-section + .ldf-section {
		padding-top: 20px;
	}

	.ldf-section-title {
		margin: 0 0 16px;
		font-size: 0.78rem;
		font-weight: 700;
		color: #2563eb;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	.ldf-field {
		margin-bottom: 16px;
	}

	.ldf-field label {
		font-size: 0.85rem;
		margin-bottom: 5px;
	}

	.ldf-field input,
	.ldf-field textarea,
	.ldf-field select {
		padding: 11px 12px;
		font-size: 16px;
	}

	.ldf-form-actions {
		padding: 12px 16px;
		gap: 10px;
	}

	.ldf-reset-btn,
	.ldf-prev-btn,
	.ldf-next-btn {
		padding: 10px 16px;
		font-size: 0.85rem;
	}

	.ldf-preview-panel {
		background: #f8fafc;
	}

	.ldf-preview-toolbar {
		padding: 10px 16px;
	}

	.ldf-preview-zoom button {
		width: 28px;
		height: 28px;
	}

	.ldf-preview-scroll {
		padding: 16px;
	}

	.ldf-preview {
		padding: 24px;
	}

	.ldf-full-preview {
		border-radius: 0;
	}

	.ldf-full-preview-body .ldf-document {
		padding: 32px;
	}

	.ldf-save-close-card,
	.ldf-download-card,
	.ldf-reset-card {
		width: 92%;
		max-width: none;
	}

	.ldf-reset-toast {
		left: 16px;
		right: 16px;
		transform: none;
		white-space: normal;
	}
}

/* When a hero/button outside the plugin is used to launch the editor,
   hide the default inline "Edit Document" button and loading text. */
.ldf-edit-document-btn,
.ldf-loading-message {
	display: none !important;
}
