.payment-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.payment-modal {
	background: white;
	border-radius: 15px;
	padding: 2rem;
	width: 90%;
	max-width: 500px;
	position: relative;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.close-button {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: #666;
	padding: 0.5rem;
	line-height: 1;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s;
}

.close-button:hover {
	background-color: #f0f0f0;
}

.close-button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.close-button:disabled:hover {
	background-color: transparent;
}

.payment-modal-busy {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2rem;
	text-align: center;
	background: rgba(255, 255, 255, 0.94);
	border-radius: 15px;
	box-sizing: border-box;
}

.payment-modal-busy-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #333;
	max-width: 280px;
}

.payment-modal-busy-hint {
	margin: 0;
	font-size: 0.875rem;
	color: #666;
	max-width: 260px;
	line-height: 1.4;
}

.spinner-busy {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(139, 69, 19, 0.2);
	border-radius: 50%;
	border-top-color: #8b4513;
	animation: spin 0.85s linear infinite;
}

.payment-modal h2 {
	margin: 0 0 1rem;
	color: #333;
	font-size: 1.5rem;
	text-align: center;
}

.payment-description {
	text-align: center;
	color: #666;
	margin-bottom: 1.5rem;
}

.price-tag {
	text-align: center;
	font-size: 2rem;
	font-weight: bold;
	color: #3498db;
	margin-bottom: 2rem;
}

.payment-form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* Exclude MUI InputLabel so modal form keeps theme consistency; only style native labels */
.payment-modal .form-group label:not(.MuiInputLabel-root):not(.MuiFormControlLabel-root) {
	font-size: 0.9rem;
	color: #666;
}

.form-group input {
	padding: 0.75rem;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 1rem;
	transition: border-color 0.2s;
}

.form-group input:focus {
	border-color: #3498db;
	outline: none;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.payment-button {
	background-color: #3498db;
	color: white;
	border: none;
	padding: 1rem;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.payment-button:hover:not(:disabled) {
	background-color: #2980b9;
}

.payment-button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.spinner {
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s linear infinite;
}

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

.payment-error {
	background-color: #fee;
	border: 1px solid #fcc;
	color: #c00;
	padding: 0.75rem;
	border-radius: 8px;
	text-align: center;
	font-size: 0.9rem;
}

.secure-badge {
	text-align: center;
	color: #666;
	font-size: 0.9rem;
	margin-top: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.card-element-container {
	padding: 0.75rem;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: white;
	transition: border-color 0.2s;
}

.card-element-container:hover {
	border-color: #bbb;
}

.card-element-container.StripeElement--focus {
	border-color: #3498db;
	box-shadow: 0 1px 3px 0 #e6ebf1;
}

.card-element-container.StripeElement--invalid {
	border-color: #e74c3c;
}
.image-version-manager {
	margin: 1rem 0;
}

.current-image-display {
	position: relative;
	margin-bottom: 1rem;
}

.current-image {
	width: 100%;
	max-width: 400px;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Special styling for cover images */
.cover-image-section .current-image {
	width: 300px;
	height: 300px;
	object-fit: cover;
	object-position: center 25%;
	border-radius: 50%;
	border: 4px solid #667eea;
	margin: 1rem 0;
}

.image-info {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem;
	align-items: center;
}

.version-badge {
	background: #667eea;
	color: white;
	padding: 0.25rem 0.5rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: bold;
}

.generation-date {
	color: #666;
	font-size: 0.75rem;
}

.image-actions {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.generate-image-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.3s ease;
}

.generate-image-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.generate-image-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.toggle-versions-btn {
	background: #f8f9fa;
	color: #495057;
	border: 2px solid #dee2e6;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.3s ease;
}

.toggle-versions-btn:hover:not(:disabled) {
	background: #e9ecef;
	border-color: #adb5bd;
}

.toggle-versions-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.version-history {
	background: #f8f9fa;
	border-radius: 12px;
	padding: 1.5rem;
	margin-top: 1rem;
}

.version-history h4 {
	margin: 0 0 1rem 0;
	color: #495057;
	font-size: 1.1rem;
}

.loading {
	text-align: center;
	color: #6c757d;
	padding: 2rem;
}

.versions-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.version-item {
	background: white;
	border-radius: 8px;
	padding: 1rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
}

.version-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.version-item.chosen {
	border: 2px solid #667eea;
	background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
}

.version-thumbnail {
	position: relative;
	margin-bottom: 0.75rem;
}

.version-thumbnail img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
}

.chosen-badge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: #28a745;
	color: white;
	padding: 0.25rem 0.5rem;
	border-radius: 12px;
	font-size: 0.7rem;
	font-weight: bold;
}

.version-details {
	text-align: center;
}

.version-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
}

.version-number {
	font-weight: bold;
	color: #495057;
}

.version-date {
	font-size: 0.75rem;
	color: #6c757d;
}

.choose-version-btn {
	background: #667eea;
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 500;
	transition: all 0.3s ease;
	width: 100%;
}

.choose-version-btn:hover:not(:disabled) {
	background: #5a67d8;
	transform: translateY(-1px);
}

.choose-version-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.image-prompt {
	margin-top: 1rem;
	padding: 1rem;
	background: #f8f9fa;
	border-radius: 8px;
	border-left: 4px solid #667eea;
}

.prompt-text {
	margin: 0;
	color: #495057;
	font-style: italic;
	line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.versions-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 0.75rem;
	}

	.version-item {
		padding: 0.75rem;
	}

	.version-thumbnail img {
		height: 100px;
	}

	.image-actions {
		flex-direction: column;
	}

	.generate-image-btn,
	.toggle-versions-btn {
		width: 100%;
	}
}
.generate-all-images-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 2.5rem 2rem 1.5rem;
	margin-top: 1rem;
}

.generate-all-images-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
	padding: 0.875rem 2rem;
	border-radius: 10px;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.05rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 280px;
}

.generate-all-images-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.generate-all-images-btn:active:not(:disabled) {
	transform: translateY(0);
}

.generate-all-images-btn:disabled {
	cursor: not-allowed;
}

.generate-all-images-btn.generating {
	background: linear-gradient(135deg, #8e9aef 0%, #9b7ec0 100%);
	opacity: 0.92;
	pointer-events: none;
}

/* Spinner */
.generate-all-images-btn .spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.75s linear infinite;
	flex-shrink: 0;
}

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

.generate-all-images-btn .btn-label {
	white-space: nowrap;
}

.generate-all-error {
	margin-top: 0.75rem;
	color: #c0392b;
	font-size: 0.9rem;
	font-weight: 500;
}
/* Reset and Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
	background: #ffffff;
}

body {
	width: 100% !important;
	max-width: 100% !important;
	font-family: "Cormorant Garamond", Georgia, serif;
	line-height: 1.6;
	color: #644f44;
	background: #ffffff;
	min-height: 100vh;
	margin: 0 !important;
	padding: 0 !important;
	overflow-x: hidden;
}

#root {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
	display: block;
}

.container {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
}

/* Mobile-first: scale up for larger screens */
@media (min-width: 640px) {
	.container {
		padding: 0 20px;
	}
}

@media (min-width: 1280px) {
	.container {
		max-width: 1200px;
	}
}

/* Header */
.header {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	padding: 2rem 0;
	text-align: center;
	margin-bottom: 3rem;
}

.header-title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 40px;
	font-weight: 700;
	color: #644f44;
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.star-icon {
	font-size: 2.5rem;
	animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
	0% {
		opacity: 0.7;
		transform: scale(1);
	}
	100% {
		opacity: 1;
		transform: scale(1.1);
	}
}

.header-subtitle {
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.2rem;
	font-weight: 300;
}

/* Main Content */
.main {
	padding-bottom: 4rem;
}

/* Section Titles - Mobile First */
.section-title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 400;
	font-size: 1.9375rem;
	color: #3d2914;
	text-align: center;
	margin-bottom: 1.5rem;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

@media (min-width: 640px) {
	.section-title {
		font-size: 2.125rem;
		margin-bottom: 2rem;
	}
}

@media (min-width: 768px) {
	.section-title {
		font-size: 2.375rem;
		margin-bottom: 2.5rem;
	}
}

/* Form Section - Mobile First */
.form-section {
	width: 100% !important;
	max-width: 100% !important;
	background: rgba(255, 255, 255, 0.98);
	border-radius: 0;
	padding: 1.25rem;
	margin: 0 !important;
	margin-bottom: 2rem;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	backdrop-filter: blur(10px);
	box-sizing: border-box;
	display: block;
}

@media (min-width: 640px) {
	.form-section {
		padding: 1.75rem;
		border-radius: 14px;
		margin-bottom: 2.5rem;
	}
}

@media (min-width: 768px) {
	.form-section {
		padding: 2.5rem;
		border-radius: 16px;
		margin-bottom: 3rem;
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
		max-width: 900px !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}
}

/* Ensure all inputs in form section have correct font - Mobile First */
.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="date"],
.form-section input[type="time"],
.form-section input[type="number"],
.form-section input[type="file"],
.form-section textarea,
.form-section select {
	font-size: 1.125rem !important;
	font-family: "Cormorant Garamond", Georgia, serif !important;
}

@media (min-width: 640px) {
	.form-section input[type="text"],
	.form-section input[type="email"],
	.form-section input[type="date"],
	.form-section input[type="time"],
	.form-section input[type="number"],
	.form-section input[type="file"],
	.form-section textarea,
	.form-section select {
		font-size: 1.125rem !important;
	}
}

.form-section input::placeholder,
.form-section textarea::placeholder {
	font-size: 1.125rem !important;
	font-family: "Cormorant Garamond", Georgia, serif !important;
	opacity: 0.6;
}

.story-form {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0;
	box-sizing: border-box;
	display: block;
}

@media (min-width: 768px) {
	.story-form {
		max-width: 900px;
		margin: 0 auto !important;
	}
}

.form-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
	.form-row {
		grid-template-columns: 1fr 1fr;
		gap: 1.5rem;
	}
}

.form-group {
	margin-bottom: 1.5rem;
}

.form-group:last-child {
	margin-bottom: 0;
}

@media (min-width: 768px) {
	.form-group {
		margin-bottom: 2rem;
	}
}

.checkbox-group {
	display: flex;
	align-items: center;
}

.checkbox-group input[type="checkbox"] {
	margin-right: 0.5rem;
}

/* Native labels (e.g. Child's Photo, Hobbies) – exclude MUI InputLabel to avoid bold/crossed overlap */
.form-group label:not(.MuiFormControlLabel-root):not(.MuiInputLabel-root) {
	display: block;
	font-weight: 600;
	color: #3d2914;
	margin-bottom: 0.75rem;
	font-size: 1.125rem;
	letter-spacing: -0.01em;
}

/* MUI floating labels: prevent border crossing through label, uniform color */
.form-section .MuiInputLabel-root.MuiInputLabel-shrink {
	background-color: rgba(255, 255, 255, 0.98) !important;
	padding: 0 6px !important;
	margin-left: -6px !important;
	color: #3d2914 !important;
	font-weight: 400 !important;
}

.form-input,
.form-select,
.form-textarea {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #e1e5e9;
	border-radius: 10px;
	font-size: 1.125rem !important;
	transition: all 0.2s ease;
	font-family: "Cormorant Garamond", Georgia, serif !important;
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;
}

/* Ensure touch targets are at least 44px */
@media (max-width: 767px) {
	.form-input,
	.form-select,
	.form-textarea {
		min-height: 44px;
		padding: 12px 14px;
	}
}

@media (min-width: 640px) {
	.form-input,
	.form-select,
	.form-textarea {
		padding: 14px 16px;
		border-radius: 12px;
	}
}

.form-input::placeholder,
.form-textarea::placeholder {
	font-size: 1.125rem !important;
	font-family: "Cormorant Garamond", Georgia, serif !important;
	opacity: 0.6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	border-color: #8b4513;
	box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-textarea {
	min-height: 100px;
	resize: vertical;
}

.hobby-hint {
	color: #8b7355;
	font-size: 0.9375rem;
	margin-top: 0.75rem;
	line-height: 1.5;
}

.file-preview {
	margin-top: 0.75rem;
	padding: 0.75rem 1rem;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e1e5e9;
	font-size: 0.9375rem;
	color: #3d2914;
}

/* Modern hobby selector styling */
.hobby-selector {
	position: relative;
}

.selected-hobbies {
	min-height: 40px;
	padding: 8px;
	border: 2px solid #e1e5e9;
	border-radius: 10px;
	margin-bottom: 8px;
	background: #f8f9fa;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.selected-hobbies:empty::before {
	content: "No hobbies selected yet...";
	color: #6c757d;
	font-style: italic;
}

.hobby-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #667eea;
	color: white;
	padding: 4px 8px;
	border-radius: 16px;
	font-size: 0.875rem;
	font-weight: 500;
}

.hobby-tag .remove-hobby {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 0;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	line-height: 1;
}

.hobby-tag .remove-hobby:hover {
	background: rgba(255, 255, 255, 0.2);
}

.hobby-dropdown-wrapper {
	position: relative;
}

.hobby-search {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid #e1e5e9;
	border-radius: 12px;
	font-size: 1rem;
	transition: all 0.2s ease;
	font-family: inherit;
	line-height: 1.5;
}

.hobby-search:focus {
	outline: none;
	border-color: #8b4513;
	box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.hobby-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 2px solid #e1e5e9;
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	max-height: 480px;
	min-height: 320px;
	overflow-y: auto;
	z-index: 1000;
	margin-top: 4px;
}

.hobby-category {
	margin-bottom: 8px;
}

.category-header {
	font-weight: 600;
	color: #495057;
	background: #f1f3f5;
	padding: 10px 12px;
	font-size: 0.875rem;
	border-bottom: 2px solid #dee2e6;
	border-top: 1px solid #dee2e6;
	position: sticky;
	top: 0;
	z-index: 1;
	cursor: default;
	user-select: none;
	display: flex;
	align-items: center;
	gap: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.category-header:first-child {
	border-top: none;
}

.category-icon {
	font-size: 0.75rem;
	opacity: 0.6;
}

.hobby-option {
	padding: 12px 14px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 0.9375rem;
	display: flex;
	align-items: center;
	gap: 8px;
	border-left: 3px solid transparent;
	margin-left: 8px;
	line-height: 1.4;
}

.hobby-option:hover {
	background: #e8f0ff;
	border-left-color: #667eea;
	transform: translateX(2px);
}

.hobby-option.selected {
	background: #667eea;
	color: white;
	border-left-color: #4c63d2;
}

.hobby-option.selected:hover {
	background: #5568d3;
	border-left-color: #3d52c1;
}

.hobby-option:active {
	transform: translateX(0);
}

.hobby-option-icon {
	font-size: 0.9rem;
	font-weight: bold;
	width: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.hobby-option-text {
	flex: 1;
}

/* Disable selection when max hobbies reached */
.hobby-option.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.hobby-option.disabled:hover {
	background: transparent;
	border-left-color: transparent;
	transform: none;
}

.hobby-option.hidden {
	display: none;
}

/* Button Styles */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 2rem;
	border: none;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	font-family: inherit;
}

.btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
	background: #f8f9fa;
	color: #555;
	border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
	background: #e9ecef;
	border-color: #d1d5db;
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
}

/* Processing Section */
.processing-section {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 20px;
	padding: 4rem 2rem;
	margin-bottom: 3rem;
	text-align: center;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.processing-card {
	max-width: 400px;
	margin: 0 auto;
}

.processing-animation {
	margin-bottom: 2rem;
}

.star-loader {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.star-loader .star {
	width: 20px;
	height: 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	clip-path: polygon(
		50% 0%,
		61% 35%,
		98% 35%,
		68% 57%,
		79% 91%,
		50% 70%,
		21% 91%,
		32% 57%,
		2% 35%,
		39% 35%
	);
	animation: starPulse 1.5s ease-in-out infinite;
}

.star-loader .star:nth-child(2) {
	animation-delay: 0.3s;
}

.star-loader .star:nth-child(3) {
	animation-delay: 0.6s;
}

@keyframes starPulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 0.7;
	}
	50% {
		transform: scale(1.3);
		opacity: 1;
	}
}

.processing-title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 30px;
	font-weight: 700;
	color: #3d3100;
	margin-bottom: 1rem;
}

.processing-progress {
	color: #666;
	font-size: 1rem;
}

/* Results Section */
.results-section {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 20px;
	padding: 2rem;
	margin-bottom: 3rem;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.results-nav {
	display: flex;
	gap: 1rem;
	margin-bottom: 2rem;
	border-bottom: 2px solid #f1f3f4;
}

.tab-btn {
	padding: 1rem 2rem;
	border: none;
	background: none;
	font-size: 1rem;
	font-weight: 500;
	color: #666;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	transition: all 0.3s ease;
}

.tab-btn.active {
	color: #667eea;
	border-bottom-color: #667eea;
}

.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
}

/* Results Actions */
.results-actions {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 2rem;
	padding: 0.75rem;
	background-color: #fafafa;
	border-radius: 12px;
}

.pdf-actions {
	display: flex;
}

/* Compact minimalist toolbar */
.action-toolbar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: flex-start;
}

.pdf-loading,
.pdf-error {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	border-radius: 8px;
	background-color: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1.1rem;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-sm {
	padding: 0.45rem 0.85rem;
	border-radius: 7px;
	font-size: 0.95rem;
}

.btn-primary {
	background-color: #3498db;
	color: white;
}

.btn-primary:hover {
	background-color: #2980b9;
}

.btn-secondary {
	background-color: #eef1f4;
	color: #2d3748;
	border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
	background-color: #e7ebf0;
}

/* Ghost button for very light secondary actions */
.btn-ghost {
	background: transparent;
	color: #374151;
	border: 1px solid #e5e7eb;
}

.btn-ghost:hover {
	background: #f5f6f8;
}

.btn-icon {
	font-size: 1.2rem;
}

.pdf-error {
	color: #e74c3c;
	background-color: #fadbd8;
}

/* Story Display */
.story-display {
	max-width: 800px;
	margin: 0 auto;
}

.story-header {
	text-align: center;
	margin-bottom: 3rem;
}

.story-title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 30px;
	font-weight: 700;
	color: #3d3100;
	margin-bottom: 0.5rem;
}

.story-subtitle {
	color: #666;
	font-size: 1.1rem;
}

.story-chapter {
	margin-bottom: 3rem;
	padding: 2rem;
	background: #f8f9fa;
	border-radius: 15px;
	border-left: 5px solid #667eea;
}

.chapter-title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 30px;
	font-weight: 700;
	color: #3d3100;
	margin-bottom: 1rem;
}

.chapter-content {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 18px;
	line-height: 1.8;
	color: #644f44;
	margin-bottom: 1.5rem;
}

.chapter-content p {
	margin-bottom: 1.2rem;
}

.chapter-content p:last-child {
	margin-bottom: 0;
}

.chapter-text-stats {
	font-size: 0.9rem;
	color: #888;
	text-align: right;
	margin: -0.5rem 0 1rem;
}

.chapter-spark {
	font-style: italic;
	color: #667eea;
	font-weight: 500;
	padding: 1rem;
	background: rgba(102, 126, 234, 0.1);
	border-radius: 10px;
	border-left: 4px solid #667eea;
}

/* Edit Interface Styles */
.chapter-header {
	display: block;
	margin-bottom: 20px;
}

.edit-controls {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 1rem;
	flex-wrap: wrap;
	width: 100%;
}

.edit-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 8px;
	font-size: 1.1rem;
	transition: all 0.3s ease;
	color: #666;
}

.edit-btn:hover {
	background: rgba(102, 126, 234, 0.1);
	color: #667eea;
	transform: scale(1.1);
}

.revert-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 8px;
	color: #dc3545;
	font-size: 0.9rem;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.revert-btn:hover {
	background: rgba(220, 53, 69, 0.1);
	color: #dc3545;
	transform: scale(1.05);
}

.version-status {
	display: block;
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
	margin-top: 0.25rem;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	font-weight: 500;
}

.version-status-main {
	font-size: 0.75rem;
	padding: 0.4rem 0.8rem;
	margin-right: 1rem;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	font-weight: 500;
	display: inline-block;
}

.version-status.chosen,
.version-status-main.chosen {
	background: rgba(40, 167, 69, 0.1);
	color: #28a745;
	border: 1px solid rgba(40, 167, 69, 0.2);
}

.version-status.not-chosen,
.version-status-main.not-chosen {
	background: rgba(102, 126, 234, 0.1);
	color: #667eea;
	border: 1px solid rgba(102, 126, 234, 0.2);
}

.version-status.not-chosen:hover,
.version-status-main.not-chosen:hover {
	background: rgba(102, 126, 234, 0.2);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.version-status.chosen:hover,
.version-status-main.chosen:hover {
	background: rgba(40, 167, 69, 0.15);
}

.version-toggle {
	display: flex;
	background: #f1f5f9;
	border-radius: 8px;
	padding: 0.2rem;
	gap: 0.2rem;
}

.version-toggle button {
	background: none;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	color: #666;
}

.version-toggle button.active {
	background: white;
	color: #667eea;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edit-interface {
	background: #f8f9fa;
	border: 2px dashed #667eea;
	border-radius: 12px;
	padding: 1.5rem;
	margin: 1rem 0;
}

.edit-interface h4 {
	color: #667eea;
	margin-bottom: 1rem;
	font-size: 1.1rem;
}

.edit-help {
	color: #666;
	font-size: 0.9rem;
	margin-bottom: 1rem;
	line-height: 1.4;
	font-style: italic;
}

.edit-textarea {
	width: 100%;
	min-height: 100px;
	padding: 1rem;
	border: 2px solid #e1e5e9;
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
	resize: vertical;
	margin-bottom: 1rem;
}

.edit-textarea:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-actions {
	display: flex;
	gap: 1rem;
	justify-content: flex-end;
}

.btn-edit {
	padding: 0.5rem 1.5rem;
	border: none;
	border-radius: 8px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 0.9rem;
}

.btn-edit-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.btn-edit-primary .edit-apply-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.75s linear infinite;
	flex-shrink: 0;
}

.btn-edit-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-edit-secondary {
	background: #f8f9fa;
	color: #666;
	border: 1px solid #e1e5e9;
}

.btn-edit-secondary:hover {
	background: #e9ecef;
}

.btn-edit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
}

.btn-edit-primary .edit-apply-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.75s linear infinite;
	flex-shrink: 0;
}

/* Footer */
.footer {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding: 2rem 0;
	text-align: center;
	color: rgba(255, 255, 255, 0.8);
}

/* Books Section */
.books-section {
	margin-top: 3rem;
}

.books-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
	margin-top: 2rem;
}

.book-card {
	background: white;
	border-radius: 12px;
	padding: 20px;
	margin: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	width: 300px;
}

.book-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.book-name {
	font-size: 1.2em;
	font-weight: bold;
	margin-bottom: 8px;
	color: #333;
}

.book-date {
	font-size: 0.9em;
	color: #666;
	margin-bottom: 12px;
}

.book-files {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.file-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 0.9em;
	color: white;
	background-color: #ccc;
	white-space: nowrap;
}

.file-badge.has-chart {
	background: #e8f0ff;
	color: #1a56db;
	border-color: #93c5fd;
}

.file-badge.has-story {
	background: #f0fdf4;
	color: #166534;
	border-color: #86efac;
}

.has-pdf {
	background-color: #e74c3c; /* Red */
}

.has-images {
	background-color: #9b59b6; /* Purple */
}

/* Chart Display */
.chart-display {
	padding: 2rem;
	background: white;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-header {
	margin-bottom: 2rem;
	text-align: center;
}

.chart-section {
	margin-bottom: 2.5rem;
	padding: 1.5rem;
	background: #f8f9fa;
	border-radius: 8px;
}

.chart-section h3 {
	color: #2c3e50;
	margin-bottom: 1.5rem;
	font-size: 1.5rem;
}

.chart-section h4 {
	color: #34495e;
	margin: 1rem 0;
	font-size: 1.2rem;
}

.soul-archetype {
	text-align: center;
}

.soul-archetype ul {
	list-style: none;
	padding: 0;
	display: flex;
	justify-content: center;
	gap: 1rem;
}

.soul-archetype li {
	background: #e9ecef;
	padding: 0.5rem 1rem;
	border-radius: 20px;
	font-weight: 500;
}

.origin-legend p {
	margin: 0.5rem 0;
	line-height: 1.6;
}

.origin-legend ul {
	list-style: none;
	padding: 0;
}

.origin-legend li {
	margin: 0.5rem 0;
	padding: 0.5rem;
	background: #e9ecef;
	border-radius: 8px;
}

.planets-grid,
.houses-grid,
.aspects-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.planet-card,
.house-card,
.aspect-card {
	background: white;
	padding: 1rem;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.planet-name,
.house-name {
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 0.5rem;
}

.planet-details,
.house-details,
.aspect-details {
	font-size: 0.9rem;
	color: #666;
	line-height: 1.4;
}

/* Soul Archetype */
.soul-archetype {
	background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
	color: white;
	padding: 2rem;
	border-radius: 15px;
	text-align: center;
	margin-bottom: 2rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.soul-archetype h3 {
	font-size: 1.8rem;
	margin: 0 0 1rem;
	color: white;
}

.dominant-elements {
	display: flex;
	gap: 1rem;
	justify-content: center;
	margin-top: 1rem;
}

.element-tag {
	background: rgba(255, 255, 255, 0.2);
	padding: 0.5rem 1.5rem;
	border-radius: 20px;
	font-size: 0.9rem;
}

/* Origin Legend */
.origin-legend {
	background: white;
	padding: 2rem;
	border-radius: 15px;
	margin-bottom: 2rem;
	position: relative;
}

.legend-item {
	margin-bottom: 1rem;
	display: flex;
	align-items: baseline;
}

.legend-label {
	color: #6366f1;
	font-weight: 500;
	margin-right: 0.5rem;
}

/* Soul Essence */
.soul-essence {
	margin: 2rem 0;
}

.soul-essence h3 {
	font-family: "Crimson Text", serif;
	font-size: 1.5rem;
	color: #333;
	text-align: center;
	margin-bottom: 1.5rem;
	position: relative;
}

.soul-essence h3:after {
	content: "";
	position: absolute;
	bottom: -0.5rem;
	left: 50%;
	transform: translateX(-50%);
	width: 100px;
	height: 2px;
	background: #e2e8f0;
}

.essence-item {
	margin-bottom: 1rem;
	padding: 1rem;
	background: #f8fafc;
	border-radius: 10px;
	position: relative;
	padding-left: 2rem;
}

.essence-item:before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: #6366f1;
	border-radius: 4px;
}

.essence-label {
	color: #6366f1;
	font-weight: 500;
	margin-bottom: 0.25rem;
}

/* Planetary Positions */
.planets-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.planet-card {
	position: relative;
	padding-left: 1.5rem;
}

.planet-card:before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #6366f1;
	border-radius: 2px;
}

.planet-name {
	font-weight: 600;
	color: #333;
	margin-bottom: 0.25rem;
}

.planet-details {
	color: #666;
	font-size: 0.9rem;
	line-height: 1.4;
}

/* House Cusps */
.houses-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 2rem;
}

.house-card {
	position: relative;
	padding-left: 1.5rem;
}

.house-card:before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #6366f1;
	border-radius: 2px;
}

.house-number {
	font-weight: 600;
	color: #333;
	margin-bottom: 0.25rem;
}

.house-details {
	color: #666;
	font-size: 0.9rem;
}

/* Major Aspects */
.aspects-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
}

.aspect-card {
	position: relative;
	padding-left: 1.5rem;
}

.aspect-card:before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #6366f1;
	border-radius: 2px;
}

.aspect-planets {
	font-weight: 500;
	color: #333;
	margin-bottom: 0.25rem;
}

.aspect-orb {
	color: #666;
	font-size: 0.85rem;
}

/* Mobile-first responsive adjustments */
@media (max-width: 639px) {
	.header-title {
		font-size: 1.75rem;
		flex-direction: column;
		gap: 0.5rem;
	}

	.results-nav {
		flex-direction: column;
		gap: 0;
	}

	.tab-btn {
		padding: 0.75rem 1rem;
		text-align: left;
	}

	.planets-grid,
	.houses-grid,
	.aspects-grid {
		grid-template-columns: 1fr;
	}

	.books-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}

@media (min-width: 640px) {
	.header-title {
		font-size: 2rem;
	}
}

@media (min-width: 768px) {
	.header-title {
		font-size: 2.5rem;
	}
}

/* Loading States */
.loading {
	opacity: 0.6;
	pointer-events: none;
}

.fadeIn {
	animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Image Generation */
.chapter-image-section {
	margin-top: 1.5rem;
	padding: 1rem;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 10px;
	text-align: center;
}

.image-loading {
	margin: 1.5rem 0;
	text-align: center;
}

.generated-image {
	margin-top: 1.5rem;
	text-align: center;
}

.generated-image img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-prompt {
	margin-top: 1rem;
	font-style: italic;
	color: #666;
	font-size: 0.9rem;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.download-button {
	display: inline-block;
	background: white;
	color: #6366f1;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	transition: transform 0.2s ease;
}

.download-button:hover {
	transform: translateY(-2px);
}

/* Chapter Controls */
.chapter-header {
	display: block;
	margin-bottom: 1.5rem;
}

.edit-chapter-btn {
	background: none;
	border: none;
	color: #6366f1;
	font-size: 1rem;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 6px;
	transition: background-color 0.2s ease;
}

.edit-chapter-btn:hover {
	background-color: rgba(99, 102, 241, 0.1);
}

.generate-image-btn {
	background: #6366f1;
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1rem;
	margin: 1.5rem 0;
	transition: background-color 0.2s ease;
}

.generate-image-btn:hover {
	background-color: #4f46e5;
}

/* Disabled state for image generation button */
.generate-image-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}

/* Chapter Image */
.chapter-image {
	margin: 1.5rem 0;
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chapter-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease;
}

.chapter-image img:hover {
	transform: scale(1.02);
}

.image-prompt {
	background: rgba(255, 255, 255, 0.95);
	padding: 1rem;
	margin: 0;
	font-size: 0.9rem;
	color: #666;
	border-bottom-left-radius: 15px;
	border-bottom-right-radius: 15px;
}

.edited-indicator {
	display: inline-flex;
	align-items: center;
	margin-left: 0.5rem;
	padding: 0.25rem 0.5rem;
	background: rgba(102, 126, 234, 0.1);
	color: #667eea;
	border-radius: 1rem;
	font-size: 0.875rem;
	font-weight: 500;
}

.archetype-card {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 20px;
	padding: 2rem;
	color: white;
	text-align: center;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.archetype-card h2 {
	font-size: 30px;
	margin-bottom: 1rem;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 700;
}

.archetype-card h4 {
	font-size: 1.2rem;
	margin-bottom: 1rem;
	opacity: 0.9;
}

.element-tags {
	display: flex;
	gap: 1rem;
	justify-content: center;
	flex-wrap: wrap;
}

.element-tag {
	background: rgba(255, 255, 255, 0.2);
	padding: 0.5rem 1rem;
	border-radius: 20px;
	font-size: 0.9rem;
}

.origin-legend {
	background: white;
	border-radius: 20px;
	padding: 2rem;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
	position: relative;
}

.origin-legend::after {
	content: "✨";
	position: absolute;
	top: 1rem;
	right: 1rem;
	font-size: 1.5rem;
}

.legend-item {
	margin-bottom: 1.5rem;
}

.legend-label {
	color: #667eea;
	font-weight: 500;
	margin-bottom: 0.25rem;
}

.legend-content {
	color: #4a5568;
	line-height: 1.6;
}

.soul-essence {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 2px solid rgba(102, 126, 234, 0.1);
}

.soul-essence h3 {
	text-align: center;
	color: #3d3100;
	margin-bottom: 1.5rem;
	position: relative;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 700;
	font-size: 30px;
}

.soul-essence h3::after {
	content: "";
	position: absolute;
	bottom: -0.5rem;
	left: 50%;
	transform: translateX(-50%);
	width: 50px;
	height: 2px;
	background: linear-gradient(to right, #667eea, #764ba2);
}

.essence-item {
	background: #f7fafc;
	padding: 1rem;
	border-radius: 10px;
	margin-bottom: 1rem;
	border-left: 4px solid #667eea;
}

.essence-label {
	color: #667eea;
	font-weight: 500;
	margin-bottom: 0.25rem;
}

.essence-content {
	color: #4a5568;
}

.main-nav {
	display: flex;
	justify-content: center;
	gap: 2rem;
	padding: 1rem 0;
	background-color: rgba(255, 255, 255, 0.1);
	margin-bottom: 2rem;
}

.nav-link {
	color: #fff;
	text-decoration: none;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.nav-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
	background-color: rgba(255, 255, 255, 0.2);
	font-weight: bold;
}
.chapter-content p {
	margin-bottom: 1em;
}

/* Loading state for action buttons */
.btn.loading .btn-icon {
	animation: spin 1s linear infinite;
}

/* Existing files list card */
.existing-files-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 0.75rem 1rem;
}

.existing-files-title {
	font-weight: 600;
	color: #374151;
	margin-bottom: 0.5rem;
}

.existing-files-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.existing-file-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.75rem;
	align-items: center;
	padding: 0.5rem 0.25rem;
	border-top: 1px solid #f3f4f6;
}

.existing-file-row:first-child {
	border-top: none;
}

.file-label {
	color: #4b5563;
}

.file-link {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
	cursor: pointer;
}

.file-link:hover {
	text-decoration: underline;
}

.primary-actions {
	margin-bottom: 12px;
}
.finalize-wrapper {
	margin-top: 12px;
}
