.pfg-app {
	max-width: 560px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: relative;
}
.pfg-app * {
	box-sizing: border-box;
}
.pfg-step {
	background: #fff;
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 18px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.pfg-step-title {
	margin: 0 0 14px;
	font-size: 17px;
	font-weight: 700;
}
.pfg-notice {
	text-align: center;
	padding: 30px;
	background: #f7f7f7;
	border-radius: 10px;
}

/* Frame selection grid */
.pfg-frame-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 12px;
}
.pfg-frame-choice {
	border: 2px solid #e5e5e5;
	background: #fafafa;
	border-radius: 10px;
	padding: 8px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, transform 0.1s ease;
}
.pfg-frame-choice:hover {
	transform: translateY(-2px);
}
.pfg-frame-choice.pfg-active {
	border-color: #2271b1;
	background: #eaf3fb;
}
.pfg-frame-choice img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
	border-radius: 6px;
	margin-bottom: 6px;
}
.pfg-frame-choice span {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

/* Buttons */
.pfg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 18px;
	border-radius: 999px;
	border: none;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.15s ease, transform 0.1s ease;
}
.pfg-btn:active {
	transform: scale(0.97);
}
.pfg-btn-primary {
	background: #000;
	color: #fff;
}
.pfg-btn-secondary {
	background: #000;
	color: #fff;
}
.pfg-btn-text {
	background: transparent;
	color: #000;
	text-decoration: underline;
}
.pfg-btn-switch {
	background: #000;
	color: #fff;
	border-radius: 50%;
	width: 42px;
	height: 42px;
	padding: 0;
	font-size: 18px;
}
.pfg-btn-block {
	width: 100%;
	padding: 13px;
	font-size: 15px;
}
.pfg-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.pfg-photo-source-buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 4px;
}

/* Camera */
.pfg-camera-wrap {
	margin-top: 14px;
	text-align: center;
}
#pfg-camera-video {
	width: 100%;
	max-width: 420px;
	border-radius: 12px;
	background: #000;
}
.pfg-camera-controls {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 12px;
}

/* Canvas editor */
.pfg-editor-wrap {
	margin-top: 16px;
	text-align: center;
}
#pfg-canvas {
	max-width: 100%;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	touch-action: none;
	cursor: grab;
	background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
#pfg-canvas:active {
	cursor: grabbing;
}
.pfg-editor-controls {
	margin-top: 12px;
}
.pfg-editor-controls label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #444;
}
.pfg-editor-controls input[type="range"] {
	width: 100%;
	margin-top: 6px;
}
.pfg-hint {
	font-size: 12px;
	color: #888;
	margin: 8px 0 0;
}

/* Form */
.pfg-form-row {
	margin-bottom: 14px;
}
.pfg-form-row label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #333;
}
.pfg-form-row input {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}
.pfg-form-row input:focus {
	outline: none;
	border-color: #2271b1;
}
.pfg-error {
	color: #c0392b;
	font-size: 13px;
	margin: -4px 0 14px;
}

/* Result */
.pfg-result-image {
	width: 100%;
	border-radius: 12px;
	display: block;
	margin-bottom: 16px;
}
.pfg-result-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.pfg-share-section {
	margin-top: 20px;
	border-top: 1px solid #eee;
	padding-top: 16px;
}
.pfg-share-title {
	font-weight: 600;
	font-size: 13px;
	margin: 0 0 10px;
	color: #444;
}
.pfg-share-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.pfg-share-btn {
	padding: 9px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	background: #000;
	color: #fff;
	text-decoration: none;
	border: none;
	cursor: pointer;
}
.pfg-share-btn:hover {
	background: #222;
}

/* Loading overlay */
.pfg-loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 99999;
}
.pfg-spinner {
	width: 42px;
	height: 42px;
	border: 4px solid #ddd;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: pfg-spin 0.8s linear infinite;
	margin-bottom: 12px;
}
@keyframes pfg-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
	.pfg-step {
		padding: 16px;
		border-radius: 10px;
	}
}
