/**
 * FLW Document Reader Pro - Frontend Styles
 */

.flw-drp-pro-wrapper {
	position: relative;
	z-index: 9000; /* Sit above normal page content and SecurePDF overlays */
	overflow: hidden; /* Prevent drawer from spilling outside viewer bounds */
}

.flw-drp-content-wrapper {
	position: relative;
	z-index: 1; /* Base layer for the viewer and its own overlays */
}

.flw-drp-overlay-root {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: 2; /* Above content wrapper, contains mask and modal */
}

.flw-drp-mask {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	/* Stronger darkening + blur so the document is not readable */
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(6px);
	pointer-events: auto; /* this blocks interaction with the viewer */
	z-index: 1; /* Relative to overlay-root, above content but below modal */
}

.flw-drp-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	/* Center the modal in the viewer */
	transform: translate(-50%, -50%);
	/* Auto width, but never larger than 600px and leave some margin on small screens */
	width: auto;
	max-width: min(600px, 100% - 40px);
	max-height: 80vh;
	background: rgba(17, 24, 39, 0.97);
	color: #f9fafb;
	font-size: 12px;
	border-radius: 8px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
	overflow: hidden;
	pointer-events: auto; /* this is clickable */
	z-index: 2; /* Relative to overlay-root, above mask */
	display: flex;
	flex-direction: column;
}

.flw-drp-panel-header {
	padding: 8px 10px;
	background: rgba(31, 41, 55, 1);
	border-bottom: 1px solid rgba(55, 65, 81, 1);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}

.flw-drp-panel-title {
	font-weight: 600;
	font-size: 12px;
}

.flw-drp-panel-tag {
	padding: 2px 6px;
	border-radius: 999px;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: rgba(59, 130, 246, 0.18);
	border: 1px solid rgba(59, 130, 246, 0.6);
}

.flw-drp-panel-body {
	padding: 10px 12px 12px;
	flex: 1 1 auto;
	min-height: 0; /* Important: allows inner scroll area to shrink in flex */
	overflow: hidden; /* Internal scroll happens inside content region */
	display: flex;
	flex-direction: column;
}

.flw-drp-panel-meta {
	font-size: 11px;
	opacity: 0.85;
	margin-bottom: 4px;
	word-break: break-all;
}

.flw-drp-panel-state {
	font-size: 11px;
	margin-top: 4px;
}

.flw-drp-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 6px;
	border-bottom: 1px solid rgba(55, 65, 81, 1);
}

.flw-drp-tab {
	flex: 1;
	padding: 4px 6px;
	text-align: center;
	font-size: 11px;
	cursor: pointer;
	border-radius: 4px 4px 0 0;
	background: transparent;
	color: #e5e7eb;
	border: 1px solid transparent;
}

.flw-drp-tab-active {
	background: rgba(31, 41, 55, 1);
	border-color: rgba(55, 65, 81, 1);
	border-bottom-color: transparent;
	font-weight: 600;
}

.flw-drp-auth-body {
	margin-top: 6px;
}

.flw-drp-field {
	display: flex;
	flex-direction: column;
	margin-bottom: 8px;
}

.flw-drp-field label {
	font-size: 11px;
	margin-bottom: 2px;
}

.flw-drp-field input {
	font-size: 11px;
	padding: 4px 6px;
	border-radius: 4px;
	border: 1px solid rgba(55, 65, 81, 1);
	background: rgba(17, 24, 39, 1);
	color: #f9fafb;
}

.flw-drp-agreement-section {
	margin-bottom: 12px;
	font-size: 11px;
	color: #d1d5db;
}

.flw-drp-signature-section {
	margin-bottom: 10px;
}

.flw-drp-signature-section label {
	font-size: 11px;
	margin-bottom: 4px;
	display: block;
	color: #f9fafb;
}

.flw-drp-signature-hint {
	margin: 0;
	font-size: 10px;
	color: #9ca3af;
	margin-bottom: 6px;
}

.flw-drp-signature-pad {
	border: 1px dashed rgba(148, 163, 184, 0.8);
	border-radius: 6px;
	padding: 4px;
	background: rgba(1, 12, 33, 1);
}

.flw-drp-signature-pad canvas {
	width: 100%;
	height: 140px;
	display: block;
	border-radius: 4px;
	background: #0f172a;
	border: 1px solid rgba(148, 163, 184, 0.6);
}

.flw-drp-signature-actions {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.flw-drp-signature-error {
	font-size: 10px;
	color: #fb7185;
	display: none;
}

.flw-drp-arc-btn-secondary {
	border-radius: 4px;
	font-size: 11px;
	padding: 6px 12px;
	border: 1px solid rgba(148, 163, 184, 0.6);
	background: transparent;
	color: #cbd5f5;
	cursor: pointer;
	transition: border-color 0.2s, color 0.2s;
}

.flw-drp-arc-btn-secondary:hover {
	border-color: rgba(148, 163, 184, 1);
	color: #fff;
}

.flw-drp-signature-preview {
	border: 1px solid rgba(75, 85, 99, 0.8);
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 12px;
	background: rgba(15, 23, 42, 1);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.flw-drp-signature-heading {
	font-size: 12px;
	font-weight: 600;
	margin: 0 0 8px;
	color: #e5e7eb;
}

.flw-drp-signature-preview img {
	width: 100%;
	max-height: 180px;
	object-fit: contain;
	border-radius: 4px;
	border: 1px solid rgba(148, 163, 184, 0.4);
	background: #0f172a;
	margin-bottom: 8px;
}

.flw-drp-signature-meta {
	font-size: 11px;
	color: #cbd5f5;
	margin-bottom: 8px;
	line-height: 1.5;
}

.flw-drp-signature-download {
	font-size: 11px;
	text-decoration: none;
	color: #3b82f6;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.flw-drp-signature-missing {
	font-size: 11px;
	color: #cbd5f5;
	margin: 0;
}

.flw-drp-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 6px;
	padding: 6px 12px;
	font-size: 11px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	background: rgba(59, 130, 246, 1);
	color: #f9fafb;
}

.flw-drp-submit-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.flw-drp-auth-note {
	font-size: 10px;
	margin-top: 4px;
	opacity: 0.8;
}

.flw-drp-forgot-link {
	display: inline-block;
	margin-top: 4px;
	font-size: 10px;
	color: #93c5fd;
	text-decoration: underline;
	cursor: pointer;
}

/* Legacy under-viewer thread panel (DEPRECATED - drawer is now canonical UI) */
/* Hidden by default - only shown if explicitly enabled via window.flwDrpEnableLegacyThreadPanel */
.flw-drp-feedback-thread-panel {
	margin-top: 16px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
	padding: 16px 18px;
	/* Hidden by default - legacy panel deprecated in favor of drawer */
	display: none;
}

.flw-drp-feedback-thread-panel-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
	font-weight: 600;
	color: #111827;
}

.flw-drp-feedback-thread-panel-subtitle {
	font-size: 12px;
	color: #6b7280;
	font-weight: 400;
}

.flw-drp-feedback-thread-panel-body {
	padding: 0;
	min-height: 130px;
}

.flw-drp-feedback-thread-loading,
.flw-drp-feedback-thread-empty {
	margin: 0;
	font-size: 13px;
	color: #6b7280;
}

.flw-drp-feedback-thread-card {
	margin-bottom: 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 10px 12px;
	background: #f9fafc;
}

.flw-drp-feedback-thread-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: #374151;
	margin-bottom: 8px;
	gap: 6px;
}

.flw-drp-feedback-thread-page,
.flw-drp-feedback-thread-reviewer {
	font-weight: 500;
}

.flw-drp-feedback-thread-messages {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.flw-drp-feedback-thread-message {
	padding: 8px 10px;
	border-radius: 6px;
	border: 1px solid #dbeafe;
	background: #fff;
}

.flw-drp-feedback-thread-message.role-author {
	background: #ecfdf5;
	border-color: #34d399;
}

.flw-drp-feedback-thread-message-meta {
	font-size: 11px;
	color: #6b7280;
	margin-bottom: 4px;
}

.flw-drp-feedback-thread-message-body {
	font-size: 13px;
	color: #111827;
	line-height: 1.5;
}

/* ARC Shell - Full Screen Layout */
.flw-drp-arc-shell {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	pointer-events: auto;
	z-index: 2; /* Above mask */
	background: rgba(17, 24, 39, 1);
}

.flw-drp-arc-main {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	transition: filter 0.3s ease;
	/* Ensure main area can shrink to accommodate footer */
	flex-shrink: 1;
}

.flw-drp-arc-main-blurred {
	filter: blur(4px) brightness(0.5);
}

.flw-drp-arc-main iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.flw-drp-arc-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: none; /* Hidden by default, shown in application mode */
	align-items: center; /* Center vertically when card is short */
	justify-content: center;
	padding: 20px;
	padding-bottom: 80px; /* Extra space to keep card above footer */
	pointer-events: none; /* Allow clicks through to footer */
	z-index: 1; /* Below footer, above blurred main */
	overflow-y: auto; /* Allow overlay to scroll if needed */
	box-sizing: border-box; /* Include padding in height calculation */
	/* Ensure overlay only covers main area, not footer - bottom constraint handled by padding */
}

.flw-drp-arc-overlay-card {
	background: rgba(17, 24, 39, 0.98);
	border-radius: 8px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
	max-width: 600px;
	width: 100%;
	max-height: calc(100% - 40px); /* Use overlay height minus padding, ensuring card stays above footer */
	display: flex;
	flex-direction: column;
	pointer-events: auto; /* Card is clickable */
	border: 1px solid rgba(55, 65, 81, 1);
	overflow: hidden; /* Ensure card content scrolls internally */
}

.flw-drp-arc-overlay-card-content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 20px;
}

/* ARC Mode Styles (Legacy - for panel-based states) */
.flw-drp-arc-content {
	flex: 1 1 auto;
	min-height: 0; /* Important: allows scrolling in flex container */
	overflow-y: auto;
	margin-bottom: 16px;
	display: flex;
	flex-direction: column;
}

.flw-drp-arc-viewer {
	width: 100%;
	flex: 1 1 auto;
	min-height: 400px; /* Ensure minimum visible height for reader */
	border-radius: 4px;
	overflow: hidden;
	background: rgba(17, 24, 39, 1);
	border: 1px solid rgba(55, 65, 81, 1);
}

.flw-drp-arc-sample-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.flw-drp-arc-no-sample {
	padding: 20px;
	text-align: center;
	color: #9ca3af;
	font-size: 11px;
}

.flw-drp-arc-load-error {
	padding: 20px;
	text-align: center;
	color: #9ca3af;
	font-size: 11px;
}

/* ARC Footer - Full Screen Layout */
.flw-drp-arc-shell .flw-drp-arc-footer {
	position: relative; /* Enable z-index stacking */
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	background: rgba(31, 41, 55, 1); /* Fully opaque dark navy background */
	border-top: 1px solid rgba(55, 65, 81, 1);
	flex: 0 0 auto; /* Stay pinned to bottom of shell */
	z-index: 20; /* Above overlay (z-index: 1) and blurred main, ensuring footer is visually on top */
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3); /* Slight shadow to emphasize it's a solid front layer */
}

.flw-drp-arc-footer-left {
	font-size: 12px;
	color: #e5e7eb;
	flex: 0 0 auto;
}

.flw-drp-arc-footer-center {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
}

.flw-drp-arc-shell .flw-drp-arc-footer-btn {
	padding: 10px 24px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	transition: background 0.2s;
	background: rgba(59, 130, 246, 1);
	color: #f9fafb;
}

.flw-drp-arc-shell .flw-drp-arc-footer-btn:hover {
	background: rgba(37, 99, 235, 1);
}

/* Legacy Footer Styles (for panel-based states) */
.flw-drp-arc-footer {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 8px;
	flex: 0 0 auto; /* Prevent footer from growing or shrinking */
}

.flw-drp-arc-footer-btn-sample {
	background: rgba(55, 65, 81, 1);
	color: #f9fafb;
	border: 1px solid rgba(75, 85, 99, 1);
}

.flw-drp-arc-footer-btn-sample:hover {
	background: rgba(75, 85, 99, 1);
}

.flw-drp-arc-footer-btn-apply {
	background: rgba(59, 130, 246, 1);
	color: #f9fafb;
}

.flw-drp-arc-footer-btn-apply:hover {
	background: rgba(37, 99, 235, 1);
}

.flw-drp-arc-footer-btn.is-active {
	opacity: 1;
}

.flw-drp-arc-footer-btn:not(.is-active) {
	opacity: 0.7;
}

.flw-drp-arc-cta {
	margin-top: 12px;
}

.flw-drp-arc-cta-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 6px 0;
	color: #f9fafb;
}

.flw-drp-arc-cta-description {
	font-size: 11px;
	margin: 0 0 12px 0;
	opacity: 0.85;
	color: #e5e7eb;
}

.flw-drp-arc-btn-primary {
	display: block;
	width: 100%;
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	background: rgba(59, 130, 246, 1);
	color: #f9fafb;
	margin-bottom: 8px;
	transition: background 0.2s;
}

.flw-drp-arc-btn-primary:hover {
	background: rgba(37, 99, 235, 1);
}

.flw-drp-arc-link-secondary {
	display: block;
	text-align: center;
	font-size: 11px;
	color: #93c5fd;
	text-decoration: underline;
	cursor: pointer;
}

.flw-drp-arc-link-secondary:hover {
	color: #60a5fa;
}

.flw-drp-arc-app-heading {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 8px 0;
	color: #f9fafb;
}

.flw-drp-arc-app-intro {
	font-size: 11px;
	opacity: 0.85;
	color: #e5e7eb;
	margin: 0 0 12px 0;
	line-height: 1.5;
}

.flw-drp-arc-app-intro p {
	margin: 0 0 8px 0;
}

.flw-drp-arc-app-intro p:last-child {
	margin-bottom: 0;
}

.flw-drp-arc-app-intro a {
	color: #93c5fd;
	text-decoration: underline;
}

.flw-drp-arc-app-intro a:hover {
	color: #60a5fa;
}

.flw-drp-arc-app-intro ul,
.flw-drp-arc-app-intro ol {
	margin: 8px 0;
	padding-left: 20px;
}

.flw-drp-arc-app-intro li {
	margin-bottom: 4px;
}

.flw-drp-arc-app-intro strong,
.flw-drp-arc-app-intro b {
	font-weight: 600;
}

.flw-drp-arc-app-intro em,
.flw-drp-arc-app-intro i {
	font-style: italic;
}

.flw-drp-arc-app-placeholder {
	font-size: 11px;
	opacity: 0.85;
	color: #e5e7eb;
	margin: 0;
}

/* ARC Application Form Styles */
.flw-drp-arc-application-form {
	margin: 0;
}

.flw-drp-form-errors {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	border-radius: 4px;
	padding: 8px;
	margin-bottom: 12px;
}

.flw-drp-form-errors ul {
	margin: 0;
	padding-left: 16px;
}

.flw-drp-form-errors li {
	color: #ef4444;
	font-size: 11px;
	margin-bottom: 4px;
}

.flw-drp-field textarea {
	font-size: 11px;
	padding: 4px 6px;
	border-radius: 4px;
	border: 1px solid rgba(55, 65, 81, 1);
	background: rgba(17, 24, 39, 1);
	color: #f9fafb;
	font-family: inherit;
	resize: vertical;
	width: 100%;
	box-sizing: border-box;
}

.flw-drp-field-error {
	display: block;
	color: #ef4444;
	font-size: 10px;
	margin-top: 2px;
}

.flw-drp-radio-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 4px;
}

.flw-drp-radio-option {
	display: flex;
	align-items: center;
	gap: 6px;
}

.flw-drp-radio-option input[type="radio"] {
	margin: 0;
	cursor: pointer;
}

.flw-drp-radio-option label {
	font-size: 11px;
	cursor: pointer;
	margin: 0;
}

.flw-drp-field input[type="checkbox"] {
	margin-right: 6px;
	cursor: pointer;
}

.flw-drp-field label[for] {
	cursor: pointer;
}

.flw-drp-agreement-section {
	margin-bottom: 12px;
}

.flw-drp-agreement-text {
	font-size: 10px;
	opacity: 0.9;
	margin-bottom: 8px;
	padding: 8px;
	background: rgba(31, 41, 55, 0.5);
	border-radius: 4px;
}

.flw-drp-account-choice-section {
	margin-top: 12px;
	margin-bottom: 12px;
}

.flw-drp-login-fields {
	margin-top: 8px;
	margin-bottom: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(55, 65, 81, 0.5);
}

.flw-drp-arc-pending-message {
	font-size: 11px;
	opacity: 0.85;
	color: #e5e7eb;
	margin: 0;
	line-height: 1.5;
}

/* Unlock behavior - when approved */
.flw-drp-unlocked .flw-drp-mask {
	display: none !important;
}

.flw-drp-unlocked .flw-drp-panel {
	display: none !important;
}

.flw-drp-unlocked .flw-drp-content-wrapper {
	pointer-events: auto;
}

/* ARC unlocked - ensure viewer is fully clear */
.flw-drp-unlocked .flw-drp-arc-main {
	filter: none !important;
	opacity: 1 !important;
}

/* ARC unlocked - do not apply any dimming from shell/overlay */
.flw-drp-unlocked .flw-drp-arc-shell,
.flw-drp-unlocked .flw-drp-arc-overlay {
	filter: none !important;
	opacity: 1 !important;
}

/* ARC unlocked - allow interaction */
.flw-drp-unlocked .flw-drp-arc-main,
.flw-drp-unlocked .flw-drp-arc-shell {
	pointer-events: auto !important;
}

/* ARC unlocked - generic blur reset inside wrapper */
.flw-drp-unlocked * {
	filter: none !important;
}

/* Status badges for admin */
.flw-drp-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.flw-drp-status-pending {
	background: rgba(251, 191, 36, 0.2);
	color: #fbbf24;
	border: 1px solid rgba(251, 191, 36, 0.4);
}

.flw-drp-status-approved {
	background: rgba(34, 197, 94, 0.2);
	color: #22c55e;
	border: 1px solid rgba(34, 197, 94, 0.4);
}

.flw-drp-status-rejected {
	background: rgba(239, 68, 68, 0.2);
	color: #ef4444;
	border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Mobile responsiveness for ARC shell */
@media (max-width: 768px) {
	.flw-drp-arc-overlay {
		padding: 10px;
		padding-bottom: 100px; /* Extra space for footer on mobile (footer may be taller due to column layout) */
	}

	.flw-drp-arc-overlay-card {
		max-width: 100%;
		max-height: calc(100% - 40px); /* Use overlay height minus padding, ensuring card stays above footer on mobile */
	}

	.flw-drp-arc-overlay-card-content {
		padding: 16px;
	}

	.flw-drp-arc-shell .flw-drp-arc-footer {
		padding: 10px 16px;
		flex-direction: column;
		gap: 8px;
	}

	.flw-drp-arc-footer-left {
		font-size: 11px;
		text-align: center;
	}

	.flw-drp-arc-footer-center {
		width: 100%;
	}

	.flw-drp-arc-shell .flw-drp-arc-footer-btn {
		width: 100%;
	}
}

/* ARC Application Card - Light Theme for Better Readability */
.flw-drp-arc-overlay-card {
	background: #ffffff;
	color: #000000;
}

/* Force all text elements inside the card to be black */
.flw-drp-arc-overlay-card h1,
.flw-drp-arc-overlay-card h2,
.flw-drp-arc-overlay-card h3,
.flw-drp-arc-overlay-card h4,
.flw-drp-arc-overlay-card h5,
.flw-drp-arc-overlay-card h6,
.flw-drp-arc-overlay-card label,
.flw-drp-arc-overlay-card p,
.flw-drp-arc-overlay-card span {
	color: #000000 !important;
}

/* Style form inputs, textareas, and selects with light theme */
.flw-drp-arc-overlay-card input[type="text"],
.flw-drp-arc-overlay-card input[type="email"],
.flw-drp-arc-overlay-card input[type="password"],
.flw-drp-arc-overlay-card textarea,
.flw-drp-arc-overlay-card select {
	background: #ffffff;
	color: #000000;
	border: 1px solid #cccccc;
}

/* Placeholder text in medium gray */
.flw-drp-arc-overlay-card input::placeholder,
.flw-drp-arc-overlay-card textarea::placeholder {
	color: #777777;
}

/* Radio and checkbox labels should be black */
.flw-drp-arc-overlay-card input[type="radio"] + label,
.flw-drp-arc-overlay-card input[type="checkbox"] + label,
.flw-drp-arc-overlay-card .flw-drp-radio-option label {
	color: #000000 !important;
}

/* ARC Application intro text - match header styling at smaller size */
.flw-drp-arc-overlay-card .flw-drp-arc-app-intro {
	color: #000000 !important;
	font-weight: 600 !important; /* Same as header */
	font-size: 12px !important; /* Slightly smaller than header's 14px */
	opacity: 1 !important; /* Override any semi-transparent styles from theme */
	font-family: inherit; /* Inherit same font family as header */
}

/* Pro action bar that sits inside the reader overlay */
.flw-drp-pro-action-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	background: rgba(17, 24, 39, 0.9);
	border-top: 1px solid rgba(59, 130, 246, 0.4);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.35);
	gap: 12px;
	pointer-events: none;
	z-index: 25;
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.35s ease;
	will-change: transform, opacity;
}

.flw-drp-pro-action-bar--visible {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.flw-drp-pro-action-bar--hidden {
	pointer-events: none;
}

.flw-drp-pro-wrapper .pdf-viewer-footer.securepdf-footer--deferred,
.flw-drp-pro-wrapper .pdf-viewer-footer.securepdf-footer--hidden {
	pointer-events: none;
	opacity: 0;
	transform: translateY(24px);
}

.flw-drp-pro-wrapper .pdf-viewer-footer.securepdf-footer--slide-in {
	pointer-events: auto;
	opacity: 1;
	transform: translateY(0);
	transition: transform 0.35s ease, opacity 0.35s ease;
}

.flw-drp-pro-action-bar-left {
	font-size: 13px;
	font-weight: 600;
	color: #f9fafb;
	flex: 1 1 auto;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.flw-drp-pro-action-bar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.flw-drp-pro-action-btn {
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(59, 130, 246, 1);
	color: #f9fafb;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.flw-drp-pro-action-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.flw-drp-feedback-drawer {
	position: absolute;
	top: 0;
	left: 10px;
	right: 10px;
	bottom: var(--drp-toolbar-h, 0px);
	background: rgba(17, 24, 39, 0.95);
	border-radius: 8px 8px 0 0;
	box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.45);
	overflow: hidden;
	width: calc(100% - 20px);
	z-index: 30;
	/* Closed state: fully hidden below viewport, non-interactive, no layout impact */
	pointer-events: none;
	transform: translateY(110%);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
	display: flex;
	flex-direction: column;
	/* Positioned relative to .flw-drp-overlay-root, constrained within .flw-drp-pro-wrapper */
	/* Height is determined by top: 0 and bottom: var(--drp-toolbar-h) */
	/* Does not affect document flow due to absolute positioning */
}

.flw-drp-feedback-drawer.is-open {
	/* Open state: visible and interactive */
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.flw-drp-feedback-btn.is-active {
	background: rgba(59, 130, 246, 0.75);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.flw-drp-feedback-drawer-content {
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
}

/* Thread container (top, scrollable, light background) */
.flw-drp-feedback-drawer-thread {
	flex: 0 0 auto;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #ffffff;
	position: relative;
	z-index: 0;
	/* Height is set dynamically via JS to fill available viewer space */
}

/* Composer section (bottom, dark panel, pinned) */
.flw-drp-feedback-drawer-composer {
	flex: 0 0 auto;
	min-height: 240px;
	background: rgba(17, 24, 39, 0.95);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	position: relative;
	z-index: 1;
	pointer-events: auto;
}

/* Header section (inside composer) */
.flw-drp-feedback-drawer-header {
	padding: 16px 16px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
}

.flw-drp-feedback-drawer-header-title {
	font-size: 16px;
	font-weight: 600;
	color: #f9fafb;
	margin-bottom: 4px;
}

.flw-drp-feedback-drawer-header-subtitle {
	font-size: 12px;
	color: #9ca3af;
}

/* Form section (inside composer) */
.flw-drp-feedback-drawer-form-section {
	padding: 16px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	pointer-events: auto;
}

.flw-drp-feedback-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.flw-drp-feedback-page-display {
	font-size: 13px;
	color: #cbd5e1;
	font-weight: 500;
}

.flw-drp-feedback-text {
	width: 100%;
	padding: 10px 12px;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	background: #ffffff;
	color: #111827;
	font-size: 13px;
	font-family: inherit;
	resize: vertical;
	box-sizing: border-box;
	position: relative;
	z-index: 1;
	pointer-events: auto;
}

.flw-drp-feedback-text:focus {
	outline: none;
	border-color: rgba(59, 130, 246, 0.6);
	background: #ffffff;
}

.flw-drp-feedback-submit-btn {
	padding: 8px 16px;
	border-radius: 6px;
	border: none;
	background: rgba(59, 130, 246, 1);
	color: #f9fafb;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
	align-self: flex-start;
	position: relative;
	z-index: 1;
	pointer-events: auto;
}

.flw-drp-feedback-submit-btn:hover {
	background: rgba(37, 99, 235, 1);
}

.flw-drp-feedback-submit-btn:active {
	background: rgba(29, 78, 216, 1);
}

.flw-drp-feedback-submit-btn:disabled {
	background: rgba(107, 114, 128, 0.6);
	cursor: not-allowed;
	opacity: 0.7;
}

.flw-drp-feedback-submit-btn.is-submitting {
	background: rgba(59, 130, 246, 0.7);
	cursor: wait;
	position: relative;
}

.flw-drp-feedback-submit-btn.is-submitting::after {
	content: '';
	position: absolute;
	width: 14px;
	height: 14px;
	top: 50%;
	left: 50%;
	margin-left: -7px;
	margin-top: -7px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	animation: flw-drp-spin 0.6s linear infinite;
}

@keyframes flw-drp-spin {
	to { transform: rotate(360deg); }
}

.flw-drp-feedback-status {
	margin-bottom: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 12px;
	line-height: 1.4;
	min-height: 20px;
}

.flw-drp-feedback-status:empty {
	display: none;
}

.flw-drp-feedback-status-error {
	background: rgba(239, 68, 68, 0.1);
	color: #fca5a5;
	border: 1px solid rgba(239, 68, 68, 0.2);
}

.flw-drp-feedback-status-success {
	background: rgba(34, 197, 94, 0.1);
	color: #86efac;
	border: 1px solid rgba(34, 197, 94, 0.2);
}

.flw-drp-feedback-status-warning {
	background: rgba(251, 191, 36, 0.1);
	color: #fcd34d;
	border: 1px solid rgba(251, 191, 36, 0.2);
}


.flw-drp-feedback-thread-loading,
.flw-drp-feedback-thread-empty {
	padding: 20px;
	text-align: center;
	font-size: 13px;
	color: #9ca3af;
	margin: 0;
}

/* Feedback messages */
.flw-drp-feedback-message {
	padding: 12px 14px;
	border-radius: 8px;
	border: 1px solid;
}

.flw-drp-feedback-message-reader {
	background: #ffffff;
	border-color: #e5e7eb;
}

.flw-drp-feedback-message-author {
	background: #ecfdf5;
	border-color: #34d399;
}

.flw-drp-feedback-message-label {
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	margin-bottom: 6px;
}

.flw-drp-feedback-message-reader .flw-drp-feedback-message-label {
	color: #6b7280;
}

.flw-drp-feedback-message-author .flw-drp-feedback-message-label {
	color: #059669;
}

.flw-drp-feedback-message-body {
	font-size: 13px;
	line-height: 1.6;
	color: #111827;
	word-wrap: break-word;
}

/* Clickable feedback messages (with page numbers) */
.flw-drp-feedback-message[data-page] {
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.flw-drp-feedback-message[data-page]:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flw-drp-feedback-message-reader[data-page]:hover {
	background: #f9fafb;
	border-color: #d1d5db;
}

.flw-drp-feedback-message-author[data-page]:hover {
	background: #d1fae5;
	border-color: #10b981;
}

/* Highlight effect for clicked messages */
.flw-drp-feedback-message-highlight {
	animation: flw-drp-feedback-highlight 0.8s ease;
}

@keyframes flw-drp-feedback-highlight {
	0% {
		box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
	}
	50% {
		box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
	}
}