/* Automancy Frontend Styles - Improved Japanese Modern Design */

:root {
	--gold-primary: #b8973d;
	--gold-light: #d4af7a;
	--gold-dark: #8a7040;
	--navy: #2a1f0e;
	--navy-light: #5a4520;
	--bg-cream: #fafafa;
	--text-dark: #2a1f0e;
	--text-light: #8a7040;
	--border-gold: rgba(184, 151, 61, 0.3);
	--border-gold-light: rgba(184, 151, 61, 0.15);
	--gold-pale: rgba(184, 151, 61, 0.08);
	--gold-border: rgba(184, 151, 61, 0.3);
	--text-mid: #5a4520;
	--serif: 'Noto Serif JP', 'Shippori Mincho', serif;
	--sans: 'M PLUS 1', sans-serif;
}

#automancy-container {
	max-width: 900px;
	margin: 0 auto;
	padding: 40px 5% 80px;
	background-color: var(--bg-cream);
	color: var(--text-dark);
	font-family: 'Noto Serif JP', serif;
	line-height: 1.6;
}

/* ===== ページタイトル ===== */
.automancy-page-title {
	text-align: center;
	margin-bottom: 50px;
	padding-bottom: 20px;
	border-bottom: none;
}

.automancy-page-title h1 {
	font-family: 'Shippori Mincho', serif;
	font-size: 32px;
	color: var(--navy);
	letter-spacing: 0.1em;
	margin-bottom: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.automancy-page-title p {
	font-size: 15px;
	color: var(--text-light);
	line-height: 1.8;
	max-width: 700px;
	margin: 0 auto;
}

/* ===== ステップインジケーター ===== */
.automancy-steps-indicator {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 60px;
	position: relative;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.automancy-steps-indicator::before {
	content: '';
	position: absolute;
	top: 24px;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--border-gold);
	z-index: 1;
}

.step-item {
	text-align: center;
	flex: 1 1 0% !important;
	min-width: 0 !important;
	transition: all 0.3s ease;
	position: relative;
	z-index: 2;
}

.step-item::after { display: none !important; }

.step-circle {
	width: 48px;
	height: 48px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: #ffffff !important;
	border: 2px solid rgba(184, 151, 61, 0.45) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: rgba(136, 136, 136, 0.45) !important;
	transition: all 0.3s ease;
	position: relative;
	z-index: 3;
}

.step-item.active .step-circle {
	background: var(--gold-primary) !important;
	border-color: var(--gold-primary) !important;
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(184, 151, 61, 0.25);
}

.step-label {
	font-size: 12px;
	color: rgba(136, 136, 136, 0.45) !important;
	letter-spacing: 1px;
	font-weight: 500;
	transition: color 0.3s ease;
	white-space: normal;
}

.step-item.active .step-label {
	color: var(--gold-primary) !important;
	font-weight: 600 !important;
}

/* ===== フォームセクション ===== */
.automancy-step-content {
	display: none;
	animation: fadeInRit 0.4s ease-out;
}

.automancy-step-content.active {
	display: block;
}

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

.automancy-step-title {
	font-family: 'Shippori Mincho', serif;
	font-size: 22px;
	color: var(--navy);
	margin-bottom: 10px;
	letter-spacing: 0.05em;
	font-weight: 700;
	text-align: left;
}

.step-title-rule {
	height: 1px;
	background: linear-gradient(90deg, var(--gold-primary), transparent);
	margin: 0 0 30px;
	width: 100%;
}

.section-subtitle {
	font-size: 14px;
	color: var(--text-light);
	margin-bottom: 30px;
	line-height: 1.6;
}

.divider-gold {
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
	margin: 40px 0;
}

/* ===== CHOICE CARDS (STEP 1) ===== */
.choice-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin-bottom: 40px;
}

.choice-card {
	background: #fff;
	border: 2px solid var(--border-gold);
	border-radius: 6px;
	padding: 28px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	position: relative;
	overflow: hidden;
}

.choice-card:hover {
	border-color: var(--gold-primary);
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(184, 151, 61, 0.15);
}

.choice-card.selected {
	border-color: var(--gold-primary);
	background: var(--gold-primary);
	color: #fff;
	box-shadow: 0 8px 20px rgba(184, 151, 61, 0.3);
}

.choice-icon {
	font-size: 32px;
	margin-bottom: 16px;
	color: var(--gold-primary);
	transition: color 0.3s ease;
}

.choice-card.selected .choice-icon { color: #fff; }

.choice-title {
	font-family: 'Shippori Mincho', serif;
	font-size: 18px;
	color: var(--navy);
	margin-bottom: 8px;
	font-weight: 700;
	letter-spacing: 0.05em;
	transition: color 0.3s ease;
}

.choice-card.selected .choice-title { color: #fff; }

.choice-desc {
	font-size: 13px;
	color: var(--text-light);
	line-height: 1.6;
	transition: color 0.3s ease;
}

.choice-card.selected .choice-desc { color: rgba(255, 255, 255, 0.9); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 32px;
	padding: 14px 16px;
	background: rgba(184, 151, 61, 0.05);
	border-radius: 6px;
	border-left: 3px solid var(--gold-primary);
	min-height: 44px;
}

.breadcrumb-label {
	font-size: 11px;
	color: var(--text-light);
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.breadcrumb-items {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.breadcrumb-item {
	background: var(--gold-primary);
	color: #fff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.5px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* sep（パンくずの区切り記号） */
.sep {
	background: var(--gold-primary);
	color: #fff;
	font-size: 11px;
	padding: 4px 10px;
}

/* ===== CATEGORY BUTTONS ===== */
.categories-container {
	display: block;
	margin-bottom: 40px;
}

.category-btn {
	background: #fff;
	border: 2px solid var(--border-gold);
	border-radius: 4px;
	padding: 12px 10px;
	text-align: center;
	cursor: pointer;
	font-family: 'Noto Serif JP', serif;
	font-size: 13px;
	color: var(--text-dark);
	font-weight: 500;
	transition: all 0.3s ease;
	letter-spacing: 0.3px;
}

.category-btn:hover {
	border-color: var(--gold-primary);
	transform: translateY(-2px);
}

.category-btn.selected {
	background: var(--gold-primary) !important;
	border-color: var(--gold-primary) !important;
	color: #fff !important;
	box-shadow: 0 4px 10px rgba(184, 151, 61, 0.2);
}

/* ===== DIRECTION CARDS ===== */
.direction-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 40px;
}

.direction-card {
	background: #fff;
	border: 2px solid var(--border-gold);
	border-radius: 6px;
	padding: 20px 15px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
	min-height: 70px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.direction-card:hover {
	border-color: var(--gold-primary);
	transform: translateY(-2px);
}

.direction-card.selected {
	background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
	border-color: var(--gold-primary);
	color: #fff;
}

.direction-title {
	font-family: 'Shippori Mincho', serif;
	font-size: 14px;
	font-weight: 700;
	color: var(--navy);
	letter-spacing: 0.05em;
}

.direction-card.selected .direction-title { color: #fff; }

/* ===== TEXTAREA & INPUTS ===== */
.textarea-container {
	margin-bottom: 24px;
}

.textarea-label {
	font-size: 15px;
	font-weight: 500;
	color: var(--text-dark);
	margin-bottom: 10px;
	letter-spacing: 1px;
}

.automancy-textarea {
	width: 100%;
	min-height: 140px;
	padding: 18px;
	border: 2px solid var(--border-gold);
	border-radius: 6px;
	font-family: 'Noto Serif JP', serif;
	font-size: 15px;
	color: var(--text-dark);
	resize: vertical;
	background: #fff;
	box-sizing: border-box;
}

.automancy-textarea:focus {
	outline: none;
	border-color: var(--gold-primary);
}

.hint {
	font-size: 12px !important;
	color: #8a7040 !important;
	letter-spacing: 0.5px !important;
	line-height: 1.7 !important;
	margin-top: 6px !important;
	font-weight: 400 !important;
}

/* ===== FORM GROUP ===== */
.form-group {
	margin-bottom: 1.4rem !important;
}

.form-group label {
	display: block !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	color: #2a1f0e !important;
	margin-bottom: 8px !important;
	letter-spacing: 1px !important;
}

.required-mark {
	color: #9a4020;
	margin-left: 4px;
	font-size: 12px;
}

.automancy-input {
	width: 100% !important;
	padding: 13px 16px !important;
	border: 1px solid rgba(184,151,61,0.3) !important;
	background: #fff !important;
	font-size: 15px !important;
	color: #2a1f0e !important;
	box-sizing: border-box !important;
	font-family: 'Noto Serif JP', serif;
}

.automancy-input:focus {
	outline: none;
	border-color: var(--gold-primary) !important;
}

/* ===== BUTTONS ===== */
.btn-next, .btn-submit-rit, .btn-submit, .btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
	color: #fff !important;
	padding: 18px 50px !important;
	font-size: 18px !important;
	font-weight: 700;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: var(--serif);
	letter-spacing: 2px;
	box-shadow: 0 4px 15px rgba(138, 112, 64, 0.25);
	min-width: 240px;
}

.btn-next:hover, .btn-submit-rit:hover, .btn-submit:hover, .btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(138, 112, 64, 0.4);
	background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
}

.btn-next:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

.btn-prev, .btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	color: var(--gold-dark) !important;
	padding: 16px 45px !important;
	font-size: 16px !important;
	font-weight: 500;
	border: 1px solid var(--border-gold);
	border-radius: 50px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.3s;
	font-family: var(--serif);
	letter-spacing: 1px;
	min-width: 180px;
}

.btn-prev:hover, .btn-secondary:hover {
	border-color: var(--gold-primary);
	color: var(--text-dark) !important;
}

.btn-area {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid var(--border-gold);
}

.btn-area.single {
	justify-content: flex-end;
}

/* ===== SELECT COUNT NOTE ===== */
.select-count-note {
	font-size: 13px !important;
	color: #8a7040 !important;
	font-family: 'M PLUS 1', 'Noto Serif JP', sans-serif !important;
	letter-spacing: 1px !important;
	line-height: 1.8 !important;
	padding: 10px 16px !important;
	border: 1px solid rgba(184,151,61,0.3) !important;
	border-left: 3px solid rgba(184,151,61,0.6) !important;
	background: rgba(184,151,61,0.05) !important;
	margin-bottom: 1.2rem !important;
	font-weight: 400 !important;
}

/* ===== TELLERS GRID ===== */
#automancy-container {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding: 40px clamp(16px, 4vw, 40px) 80px !important;
	box-sizing: border-box !important;
}

#step-2 {
	width: 100% !important;
	max-width: 100% !important;
}

#tellers-grid,
.tellers-grid {
	display: grid !important;
	gap: 12px !important;
	margin: 0 0 1.5rem !important;
	width: 100% !important;
}

/* PC: 4カラム */
@media (min-width: 768px) {
	#tellers-grid,
	.tellers-grid {
		grid-template-columns: repeat(4, 1fr) !important;
	}
}

/* スマホ: 2カラム（767px以下） */
@media (max-width: 767px) {
	#tellers-grid,
	.tellers-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 8px !important;
	}
}

/* ===== TELLER CARD ===== */
.teller-card {
	border: 1px solid rgba(184,151,61,0.3) !important;
	cursor: pointer !important;
	transition: all 0.2s !important;
	position: relative !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	text-align: center !important;
	padding: 16px 10px 14px !important;
	overflow: hidden !important;
	background: #fff !important;
	box-sizing: border-box !important;
}

.teller-card:hover {
	border-color: #c9a84c !important;
	background: rgba(184,151,61,0.10) !important;
}

.teller-card.selected {
	border-color: #b8973d !important;
	border-width: 2px !important;
	background: #fffdf5 !important;
	box-shadow: 0 4px 12px rgba(184,151,61,0.2) !important;
}

.selected-badge {
	display: none !important;
	background: #b8973d !important;
	color: #fff !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	padding: 6px 0 !important;
	text-align: center !important;
	letter-spacing: 2px !important;
	flex-shrink: 0 !important;
	margin: -16px -10px 12px !important;
	width: calc(100% + 20px) !important;
}
.selected-badge::before {
	content: '✓';
	margin-right: 4px;
}

.teller-card.selected .selected-badge {
	display: block !important;
}

.card-top-spacer {
	height: 14px !important;
	width: 100% !important;
	flex-shrink: 0 !important;
}

.teller-card.selected .card-top-spacer {
	display: none !important;
}

.teller-photo-wrap {
	width: 72px !important;
	height: 72px !important;
	border-radius: 50% !important;
	border: 1.5px solid rgba(184,151,61,0.3) !important;
	background: #f5f0e8 !important;
	margin: 0 auto 8px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 28px !important;
	overflow: hidden !important;
	flex-shrink: 0 !important;
	max-width: 100% !important;
	transition: border-color 0.2s !important;
}

.teller-card.selected .teller-photo-wrap {
	border-color: #c9a84c !important;
}

.teller-photo-wrap img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}

.teller-name {
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #2a1f0e !important;
	letter-spacing: 2px !important;
	margin-bottom: 4px !important;
}

.teller-jutsu {
	display: inline-block !important;
	font-size: 9px !important;
	letter-spacing: 1.5px !important;
	color: #8a7040 !important;
	border: 1px solid rgba(184,151,61,0.3) !important;
	padding: 2px 8px !important;
	margin-bottom: 7px !important;
	background: transparent !important;
}

.teller-tags {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 3px !important;
	justify-content: center !important;
	margin-bottom: 8px !important;
	padding: 0 8px !important;
}

.teller-tag {
	font-size: 9px !important;
	background: rgba(184,151,61,0.08) !important;
	border: 1px solid rgba(184,151,61,0.3) !important;
	color: #8a7040 !important;
	padding: 1px 6px !important;
	letter-spacing: 0.5px !important;
}

.teller-desc {
	font-size: 11px !important;
	color: #5a4520 !important;
	line-height: 1.75 !important;
	text-align: left !important;
	padding: 0 12px !important;
}

/* ===== SELECTED COUNT DISPLAY ===== */
.selected-count-display {
	font-size: 13px !important;
	color: #8a7040 !important;
	font-family: 'M PLUS 1', sans-serif !important;
	letter-spacing: 1px !important;
	text-align: center !important;
	padding: 10px !important;
	background: rgba(184,151,61,0.06) !important;
	border: 1px solid rgba(184,151,61,0.2) !important;
	margin-bottom: 1.2rem !important;
}

.selected-count-display #selected-count {
	font-weight: 700 !important;
	color: #b8973d !important;
	font-size: 16px !important;
}

/* ===== SUMMARY BOX ===== */
.summary-box {
	border: 1px solid rgba(184,151,61,0.3) !important;
	padding: 20px !important;
	margin-bottom: 1.5rem !important;
	background: #fff !important;
	border-radius: 0 !important;
}

.summary-row {
	display: flex !important;
	flex-direction: row !important;
	gap: 16px !important;
	padding: 10px 0 !important;
	border-bottom: 1px solid rgba(184,151,61,0.12) !important;
	align-items: baseline !important;
}

.summary-row:last-child {
	border-bottom: none !important;
}

.summary-label {
	width: 80px !important;
	flex-shrink: 0 !important;
	font-size: 13px !important;
	color: #8a7040 !important;
	letter-spacing: 1px !important;
}

.summary-value {
	font-size: 15px !important;
	color: #2a1f0e !important;
	flex: 1 !important;
	line-height: 1.7 !important;
}

.summary-price-row {
	display: flex !important;
	flex-direction: row !important;
	align-items: baseline !important;
	gap: 8px !important;
	padding-top: 14px !important;
	border-top: 1px solid rgba(184,151,61,0.2) !important;
	margin-top: 10px !important;
	background: rgba(184,151,61,0.05) !important;
	padding: 14px 10px 10px !important;
	margin: 10px -20px -20px !important;
}

.summary-price-label {
	font-size: 13px !important;
	color: #8a7040 !important;
	letter-spacing: 1px !important;
	margin-right: auto !important;
}

.summary-price-value {
	font-size: 24px !important;
	font-weight: 700 !important;
	color: #2a1f0e !important;
}

.summary-price-unit {
	font-size: 13px !important;
	color: #8a7040 !important;
}

/* ===== GOLD RULE ===== */
.gold-rule {
	width: 100% !important;
	height: 1px !important;
	background: linear-gradient(to right, transparent, rgba(184,151,61,0.3) 30%, rgba(184,151,61,0.3) 70%, transparent) !important;
	margin: 1.8rem 0 !important;
	border: none !important;
	display: block !important;
}

/* ===== TERMS ===== */
.terms-scroll {
	border: 1px solid rgba(184,151,61,0.3);
	padding: 14px 16px;
	height: 120px;
	overflow-y: scroll;
	font-size: 13px;
	line-height: 2;
	color: var(--text-mid);
	font-family: var(--sans);
	margin-bottom: 10px;
	background: #fff;
}

.terms-agree-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 16px;
	border: 1px solid rgba(184,151,61,0.3);
	cursor: pointer;
	transition: background 0.2s;
}

.terms-agree-wrap:hover {
	background: rgba(184,151,61,0.05);
}

.terms-agree-wrap input[type="checkbox"] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: var(--gold-primary);
}

.terms-agree-wrap span {
	font-size: 14px;
	color: var(--text-dark);
	letter-spacing: 1px;
}

/* ===== VALIDATION ===== */
.validation-message {
	background: #ffe8e8;
	border: 1px solid #ffd1d1;
	border-radius: 6px;
	padding: 14px 16px;
	margin-bottom: 24px;
	font-size: 14px;
	color: #d63638;
	display: none;
}

.validation-message.show {
	display: block;
	animation: shakeRit 0.4s ease;
}

@keyframes shakeRit {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-8px); }
	75% { transform: translateX(8px); }
}

/* ===== スマホ全体レスポンシブ ===== */
@media (max-width: 768px) {
	.automancy-page-title {
		text-align: left !important;
		padding: 0 10px !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.automancy-page-title h1 {
		text-align: left !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		width: 100% !important;
		font-size: 24px !important;
		letter-spacing: 0.05em !important;
	}
	.automancy-page-title p {
		text-align: left !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
	}
	.automancy-page-title p br {
		display: none !important;
	}
	.choice-grid { grid-template-columns: 1fr; }
	.direction-grid { grid-template-columns: 1fr; }
	.categories-container { grid-template-columns: repeat(2, 1fr); }
	/* tellers-grid はスマホ用ルールで個別制御 */

	#automancy-container {
		padding: 20px 6px 80px 6px !important;
	}

	.teller-card {
		padding: 12px 6px 10px !important;
	}

	.selected-badge {
		margin: -12px -6px 10px !important;
		width: calc(100% + 12px) !important;
	}

	.teller-photo-wrap {
		width: 60px !important;
		height: 60px !important;
		font-size: 24px !important;
	}

	.teller-name {
		font-size: 13px !important;
		letter-spacing: 1px !important;
	}

	.teller-desc {
		font-size: 11px !important;
		padding: 0 4px !important;
	}

	.btn-next {
		min-width: 160px;
		padding: 14px 24px !important;
		font-size: 15px !important;
	}

	.btn-prev {
		min-width: 100px;
		padding: 12px 20px !important;
	}
}

/* ===== Payment ===== */
.payment-container {
	padding: 1.5rem 0;
}

.payment-info-box {
	background: var(--gold-pale);
	padding: 1.5rem;
	border: 1.5px solid var(--border-gold);
	margin-bottom: 2rem;
	text-align: center;
}

.payment-msg {
	font-size: 15px;
	color: var(--text-dark);
	margin-bottom: 1rem;
	font-family: var(--sans);
}

.payment-amount-display {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 10px;
}

.payment-amount-display .label {
	font-size: 14px;
	color: var(--text-mid);
}

.payment-amount-display .value {
	font-size: 32px;
	font-weight: 700;
	color: var(--text-dark);
	font-family: var(--serif);
}

.payment-amount-display .unit {
	font-size: 14px;
	color: var(--text-mid);
}

#card-element {
	padding: 18px 16px;
	border: 1.5px solid var(--border-gold);
	background: #fff;
	margin-bottom: 1rem;
	transition: all 0.3s;
}

#card-errors {
	color: #d63638;
	font-size: 13px;
	margin-bottom: 1.5rem;
	font-family: var(--sans);
	text-align: center;
	min-height: 1.5rem;
}

.payment-waiting-msg {
	text-align: center;
	margin-bottom: 1.5rem;
}

.payment-waiting-msg p {
	font-size: 14px;
	color: var(--gold-light);
	font-weight: 500;
	margin-top: 10px;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0% { opacity: 0.6; }
	50% { opacity: 1; }
	100% { opacity: 0.6; }
}

.spinner-small {
	width: 24px;
	height: 24px;
	border: 2px solid rgba(184, 151, 61, 0.2);
	border-top-color: var(--gold-light);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	display: inline-block;
}

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

/* ===== Ritual Page ===== */
#ritual-page {
	max-width: 640px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
	font-family: var(--serif);
}

.ritual-header {
	text-align: center;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border-gold);
	margin-bottom: 2rem;
}

.ritual-header h1 {
	font-size: 22px;
	font-weight: 700;
	color: var(--text-dark);
	letter-spacing: 3px;
	margin-bottom: 6px;
}

.ritual-header p {
	font-size: 13px;
	color: var(--text-light);
	font-family: var(--sans);
	letter-spacing: 1px;
}

.progress-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	margin-bottom: 2rem;
}

.progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	flex: 1;
	position: relative;
}

.progress-step::after {
	content: '';
	position: absolute;
	top: 16px;
	left: calc(50% + 16px);
	right: calc(-50% + 16px);
	height: 1px;
	background: var(--border-gold);
}

.progress-step:last-child::after { display: none; }

.progress-dot {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1.5px solid var(--border-gold);
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-family: var(--sans);
	color: var(--text-light);
	position: relative;
	z-index: 1;
	transition: all 0.3s;
}

.progress-step.active .progress-dot {
	background: var(--text-dark);
	border-color: var(--text-dark);
	color: #e8d5a8;
}

.progress-step.done .progress-dot {
	background: var(--gold-light);
	border-color: var(--gold-light);
	color: #fff;
}

.progress-step.done .progress-dot::after {
	content: '✓';
	font-size: 13px;
}

.progress-step.done .progress-dot span { display: none; }

.progress-label {
	font-size: 10px;
	letter-spacing: 1px;
	color: var(--text-light);
	font-family: var(--sans);
	text-align: center;
	white-space: nowrap;
}

.progress-step.active .progress-label {
	color: var(--text-dark);
	font-weight: 500;
}

.ritual-block {
	display: none;
	animation: fadeUp 0.4s ease;
}

.ritual-block.active { display: block; }

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

.teller-header-rit {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 0 16px;
	border-bottom: 1px solid var(--border-gold);
	margin-bottom: 20px;
}

.teller-avatar-rit {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 1.5px solid var(--border-gold);
	background: #f5f0e8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	flex-shrink: 0;
	overflow: hidden;
}

.teller-avatar-rit img { width: 100%; height: 100%; object-fit: cover; }

.teller-eyebrow-rit {
	font-size: 9px;
	letter-spacing: 4px;
	color: var(--text-light);
	font-family: var(--sans);
	margin-bottom: 3px;
}

.teller-name-large {
	font-family: var(--serif);
	font-size: 20px;
	font-weight: 700;
	color: var(--text-dark);
	letter-spacing: 2px;
}

.teller-jutsu-badge {
	display: inline-block;
	font-size: 9px;
	letter-spacing: 2px;
	color: var(--text-light);
	border: 1px solid var(--border-gold);
	padding: 2px 10px;
	margin-top: 5px;
	font-family: var(--sans);
}

.teller-message-rit {
	font-size: 14px;
	line-height: 2.2;
	color: var(--text-mid);
	border-left: 2px solid var(--gold-light);
	padding: 10px 14px;
	margin-bottom: 20px;
}

.input-area-rit {
	border: 1px solid var(--border-gold);
	margin-bottom: 20px;
	overflow: hidden;
}

.input-area-label-rit {
	background: var(--gold-pale);
	border-bottom: 1px solid var(--border-gold);
	padding: 8px 16px;
	font-size: 9px;
	letter-spacing: 4px;
	color: var(--text-light);
	font-family: var(--sans);
	display: flex;
	align-items: center;
	gap: 6px;
}

.input-area-label-rit::before { content: '◈'; color: var(--gold-light); }
.input-area-body-rit { padding: 18px 16px; }

.loading-screen {
	display: none;
	text-align: center;
	padding: 3rem 1rem;
	animation: fadeUp 0.5s ease;
}

.loading-screen.active { display: block; }

.loading-tellers {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}

.loading-teller-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.loading-avatar-rit {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1.5px solid var(--border-gold);
	background: #f5f0e8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	position: relative;
	overflow: hidden;
}

.loading-avatar-rit img { width: 100%; height: 100%; object-fit: cover; }

.loading-avatar-rit.spinning::after {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid transparent;
	border-top-color: var(--gold-light);
	animation: spin-rit 1.4s linear infinite;
}

.loading-avatar-rit.done::after {
	content: '✓';
	position: absolute;
	inset: 0;
	background: rgba(201,168,76,0.12);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	color: var(--gold-light);
}

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

.loading-bar-wrap {
	width: 100%;
	max-width: 320px;
	margin: 0 auto 1.5rem;
	height: 2px;
	background: rgba(184, 151, 61, 0.15);
	position: relative;
	overflow: hidden;
}

.loading-bar-fill {
	height: 100%;
	background: var(--gold-light);
	width: 0%;
	transition: width 0.5s ease;
}

.complete-screen {
	display: none;
	text-align: center;
	padding: 2rem 1rem;
	animation: fadeUp 0.5s ease;
}

.complete-screen.active { display: block; }

/* ===== TERMS SCROLLBAR CUSTOMIZATION ===== */
.terms-scroll::-webkit-scrollbar {
	width: 6px !important;
}

.terms-scroll::-webkit-scrollbar-track {
	background: rgba(184, 151, 61, 0.03) !important;
	border-left: 1px solid rgba(184, 151, 61, 0.1) !important;
}

.terms-scroll::-webkit-scrollbar-thumb {
	background: rgba(184, 151, 61, 0.25) !important;
	border-radius: 3px !important;
	transition: background 0.3s ease !important;
}

.terms-scroll::-webkit-scrollbar-thumb:hover {
	background: rgba(184, 151, 61, 0.45) !important;
}

/* ===== CARD PICK / NUMEROLOGY DECK ===== */
.card-pick-wrap {
	text-align: center;
	padding: 10px 0;
}

.card-pick-wrap label {
	display: block;
	font-family: var(--serif);
	font-size: 15px;
	color: var(--text-dark);
	margin-bottom: 12px;
	letter-spacing: 1px;
}

.card-deck {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 15px 0;
}

.card-item {
	width: 44px;
	height: 44px;
	border-radius: 50% !important;
	border: 1px solid rgba(184, 151, 61, 0.3) !important;
	background: #ffffff !important;
	color: #8a7040 !important;
	font-size: 16px;
	font-weight: 700;
	font-family: 'Noto Serif JP', serif;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
	transition: all 0.25s ease;
	outline: none;
	/* ボタンの基本スタイルリセット */
	padding: 0 !important;
	min-width: 44px !important;
	flex: none !important;
	letter-spacing: normal !important;
	white-space: normal !important;
}

.card-item:hover {
	border-color: rgba(184, 151, 61, 0.8) !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(184, 151, 61, 0.15);
	background: rgba(184, 151, 61, 0.02) !important;
}

.card-item.selected {
	background: linear-gradient(135deg, #b8973d, #8a7040) !important;
	color: #ffffff !important;
	border-color: #8a7040 !important;
	box-shadow: 0 4px 10px rgba(138, 112, 64, 0.35);
	transform: scale(1.08);
}

.card-hint {
	font-size: 12px;
	color: var(--text-light);
	margin-top: 10px;
}

/* ===== 決済完了オーバーレイ（モーダル） ===== */
.payment-success-overlay {
	position: fixed;
	inset: 0;
	background: rgba(42, 31, 14, 0.85);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s ease;
}

.payment-success-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.payment-success-modal {
	background: #ffffff;
	border: 1px solid rgba(184, 151, 61, 0.3);
	border-radius: 8px;
	padding: 40px clamp(20px, 5vw, 50px);
	text-align: center;
	max-width: 420px;
	width: 90%;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	box-sizing: border-box;
}

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

/* 金のチェックマークアニメーション */
.checkmark-circle {
	width: 80px;
	height: 80px;
	position: relative;
	display: inline-block;
	vertical-align: top;
	margin: 0 auto 20px;
}

.checkmark-circle .background {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: rgba(184, 151, 61, 0.1);
	position: absolute;
}

.checkmark-circle .checkmark {
	display: none;
}

.checkmark-circle .checkmark.draw::after {
	animation-duration: 800ms;
	animation-timing-function: ease;
	animation-name: checkmark;
	transform: scaleX(-1) rotate(135deg);
}

.checkmark-circle .checkmark::after {
	opacity: 1;
	height: 40px;
	width: 20px;
	transform-origin: left top;
	border-right: 3px solid #b8973d;
	border-top: 3px solid #b8973d;
	content: '';
	left: 20px;
	top: 40px;
	position: absolute;
}

@keyframes checkmark {
	0% { height: 0; width: 0; opacity: 1; }
	20% { height: 0; width: 20px; opacity: 1; }
	40% { height: 40px; width: 20px; opacity: 1; }
	100% { height: 40px; width: 20px; opacity: 1; }
}

.checkmark-circle .checkmark {
	display: block;
}

.payment-success-modal h2.success-title {
	font-family: 'Shippori Mincho', serif;
	font-size: 22px;
	color: #2a1f0e;
	margin: 10px 0;
	letter-spacing: 1px;
}

.payment-success-modal p.success-subtitle {
	font-size: 13px;
	color: #8a7040;
	font-family: 'M PLUS 1', sans-serif;
	line-height: 1.8;
	margin: 0;
}

/* ===== スマホ表示の最適化（謎スペース・はみ出し防止） ===== */
@media (max-width: 767px) {
	#automancy-container {
		overflow-x: hidden !important;
		padding: 30px 16px 60px !important;
	}

	.automancy-steps-indicator {
		max-width: 100% !important;
		padding: 0 10px !important;
		box-sizing: border-box !important;
	}

	/* クーポン入力欄の最適化：サイズ感の逆転 */
	.coupon-box div[style*="display:flex"],
	.coupon-box div {
		display: flex !important;
		gap: 8px !important;
	}

	#coupon-code-input {
		flex: 3.5 !important;
		width: 0 !important;
		min-width: 0 !important;
		padding: 10px 12px !important;
		font-size: 14px !important;
	}

	#btn-apply-coupon {
		flex: 1.5 !important;
		min-width: 80px !important;
		max-width: 120px !important;
		padding: 10px 5px !important;
		font-size: 12px !important;
		text-align: center !important;
		justify-content: center !important;
		white-space: nowrap !important;
		height: 44px !important;
		box-sizing: border-box !important;
	}

	/* ボタンの途切れ・はみ出し解消 */
	.btn-area {
		flex-direction: row !important;
		justify-content: space-between !important;
		gap: 8px !important;
		padding-top: 20px !important;
		margin-top: 30px !important;
	}

	/* .card-itemはbtn-primaryと衝突するため除外 */
	.btn-next, .btn-submit-rit, .btn-submit,
	.btn-primary:not(.card-item):not(#btn-apply-coupon) {
		min-width: 0 !important;
		flex: 1 !important;
		padding: 14px 8px !important;
		font-size: 13px !important;
		letter-spacing: 0.5px !important;
		white-space: nowrap !important;
		border-radius: 30px !important;
	}

	.btn-prev, .btn-secondary {
		min-width: 0 !important;
		flex: 1 !important;
		padding: 14px 8px !important;
		font-size: 13px !important;
		letter-spacing: 0.5px !important;
		white-space: nowrap !important;
		border-radius: 30px !important;
	}

	/* 生年月日・出生時間・セレクトボックス等のはみ出し修正 */
	.automancy-input,
	input[type="date"].automancy-input,
	input[type="time"].automancy-input,
	select.automancy-input {
		max-width: 100% !important;
		width: 100% !important;
		box-sizing: border-box !important;
		display: block !important;
	}

	/* 数秘術の生年月日入力欄のはみ出し専用修正 */
	.numerology-input-wrap .rit-input-col,
	.numerology-input-wrap .rit-input-col.full-width {
		width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
	}

	.numerology-input-wrap input[type="date"] {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		display: block !important;
	}

	/* card-itemをスマホメディアクエリのフレックス影響から完全保護 */
	.card-item {
		width: 38px !important;
		height: 38px !important;
		min-width: 38px !important;
		flex: none !important;
		padding: 0 !important;
		border-radius: 50% !important;
		font-size: 14px !important;
		letter-spacing: normal !important;
		white-space: normal !important;
	}

	/* ローディング画面のアバターを横並びに強制 */
	.loading-tellers {
		flex-wrap: nowrap !important;
		gap: 8px !important;
		overflow-x: auto !important;
		justify-content: flex-start !important;
		padding-bottom: 15px !important;
		margin-bottom: 1.5rem !important;
	}

	.loading-teller-item {
		min-width: 72px !important;
		gap: 4px !important;
	}

	.loading-avatar-rit {
		width: 48px !important;
		height: 48px !important;
		font-size: 20px !important;
	}

	.loading-teller-name {
		font-size: 11px !important;
		white-space: nowrap !important;
		text-overflow: ellipsis !important;
		overflow: hidden !important;
		max-width: 72px !important;
	}

	.loading-status {
		font-size: 10px !important;
	}
}