
/* ページ上：見積もりを開くボタンの置き場 */
.jssa-fest-fee-calc {
	margin: 2rem 0;
}

.jssa-fest-fee-calc__open {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.65rem 1.25rem;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--color-accent-foreground, #fff);
	background: var(--color-primary, hsl(215, 70%, 45%));
	border: none;
	border-radius: var(--radius, 0.5rem);
	cursor: pointer;
	transition: background 0.15s ease;
}

.jssa-fest-fee-calc__open:hover,
.jssa-fest-fee-calc__open:focus-visible {
	background: var(--color-primary-hover, hsl(215, 70%, 40%));
	outline: 2px solid var(--color-primary, hsl(215, 70%, 45%));
	outline-offset: 2px;
}

/* dialog 本体・背後の暗転 */
.jssa-fest-fee-calc__dialog {
	width: min(100% - 2rem, 80rem);
	max-height: min(90vh, 85rem);
	max-height: min(90dvh, 85rem);
	box-sizing: border-box;
	padding: max(0px, env(safe-area-inset-top, 0px)) max(0px, env(safe-area-inset-right, 0px)) max(0px, env(safe-area-inset-bottom, 0px)) max(0px, env(safe-area-inset-left, 0px));
	border: 1px solid var(--color-border, hsl(220, 15%, 90%));
	border-radius: var(--radius, 0.5rem);
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
	background: var(--color-background, #fff);
	color: var(--color-foreground, hsl(220, 20%, 15%));
	overflow: hidden;
}

.jssa-fest-fee-calc__dialog::backdrop {
	background: rgba(15, 23, 42, 0.45);
}

/* モーダル内：ヘッダー〜本文〜フッターの縦並び */
.jssa-fest-fee-calc__dialog-inner {
	display: flex;
	flex-direction: column;
	max-height: min(100vh, 80rem);
	max-height: min(100dvh, 80rem);
	min-height: 0;
	overflow: hidden;
}

.jssa-fest-fee-calc__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 1rem 1.5rem 3rem;
}

/* タイトル行と閉じる（×） */
.jssa-fest-fee-calc__head {
	flex-shrink: 0;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.5rem 1.25rem;
	border-bottom: 1px solid var(--color-border, hsl(220, 15%, 90%));
}

.jssa-fest-fee-calc__title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.35;
}

.jssa-fest-fee-calc__close {
	flex-shrink: 0;
	min-width: 2.75rem;
	min-height: 2.75rem;
	width: 2.75rem;
	height: 2.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 1.85rem;
	line-height: 1;
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
	background: transparent;
	border: none;
	border-radius: var(--radius-sm, 0.25rem);
	cursor: pointer;
}

.jssa-fest-fee-calc__close:hover,
.jssa-fest-fee-calc__close:focus-visible {
	color: var(--color-foreground, hsl(220, 20%, 15%));
	background: var(--color-muted, hsl(220, 15%, 96%));
	outline: none;
}


/* 冒頭の説明テキスト */
.jssa-fest-fee-calc__intro {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	line-height: 1.55;
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
}

/* 会員／非会員ラジオ */
.jssa-fest-fee-calc__radios {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.25rem;
	align-items: center;
	margin-top: 0.35rem;
}

.jssa-fest-fee-calc__radio-label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	color: var(--color-foreground, hsl(220, 20%, 15%));
}

.jssa-fest-fee-calc__radio-label input {
	width: auto;
	margin: 0;
	accent-color: var(--color-primary, hsl(215, 70%, 45%));
}

/* スポンサー申込・プラン選択ブロック */
.jssa-fest-fee-calc__field--sponsor .jssa-fest-fee-calc__check-label {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-bottom: 0.65rem;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	color: var(--color-foreground, hsl(220, 20%, 15%));
}

.jssa-fest-fee-calc__field--sponsor .jssa-fest-fee-calc__check-label input {
	width: auto;
	margin: 0;
	accent-color: var(--color-primary, hsl(215, 70%, 45%));
}

.jssa-fest-fee-calc__field--sponsor {
	padding-bottom: 0.85rem;
	margin-bottom: 1.35rem;
	border-bottom: 1px solid hsl(220, 15%, 82%);
}

/* ネイティブ select 展開時に下段の number と重なって見えにくくする */
.jssa-fest-fee-calc__field--sponsor:focus-within {
	position: relative;
	z-index: 3;
}

/* スポンサー：プランラベル周り */
.jssa-fest-fee-calc__plan-wrap {
	margin-top: 0;
}

.jssa-fest-fee-calc__plan-wrap .jssa-fest-fee-calc__label {
	margin-top: 0.25rem;
}

/* 人数・ラベル・入力・セレクト共通 */
.jssa-fest-fee-calc__field {
	margin-bottom: 1rem;
}

.jssa-fest-fee-calc__field:last-child {
	margin-bottom: 0;
}

.jssa-fest-fee-calc__label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-foreground, hsl(220, 20%, 15%));
}

.jssa-fest-fee-calc__hint {
	margin: 0.25rem 0 0;
	font-size: 0.75rem;
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
	line-height: 1.45;
}

/* テキスト入力・プルダウン */
.jssa-fest-fee-calc__select,
.jssa-fest-fee-calc__input {
	width: 100%;
	padding: 0.5rem 0.65rem;
	font-family: inherit;
	font-size: 0.9375rem;
	color: var(--color-foreground, hsl(220, 20%, 15%));
	background: var(--color-background, #fff);
	border: 1px solid var(--color-input, hsl(220, 15%, 90%));
	border-radius: var(--radius-sm, 0.25rem);
}

.jssa-fest-fee-calc__select:focus-visible,
.jssa-fest-fee-calc__input:focus-visible {
	outline: 2px solid var(--color-primary, hsl(215, 70%, 45%));
	outline-offset: 1px;
}

.jssa-fest-fee-calc__select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	background: var(--color-muted, hsl(220, 15%, 96%));
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
}

/* 内訳リスト・合計・注釈の結果エリア */
.jssa-fest-fee-calc__result {
	margin-top: 1.4rem;
}

.jssa-fest-fee-calc__result-panel {
	padding: 0.95rem 1.35rem 1.35rem;
	border-radius: var(--radius, 0.5rem);
	background: var(--color-muted, hsl(220, 15%, 96%));
	border: 1px solid var(--color-border, hsl(220, 15%, 90%));
}

.jssa-fest-fee-calc__result-total-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
	margin-bottom: 0.25rem;
}

.jssa-fest-fee-calc__result-total-label--grand {
	margin-top: 0.2rem;
	margin-bottom: 0.25rem;
	border-top: 1px solid var(--color-border, hsl(220, 15%, 88%));
	color: var(--color-foreground, hsl(220, 20%, 15%));
	font-size: 1.2rem;
}

.jssa-fest-fee-calc__result-total {
	text-align: right;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-primary, hsl(215, 70%, 45%));
	margin-bottom: 0.45rem;
}

.jssa-fest-fee-calc__result-list {
	list-style: none;
	margin: 0 0 0.15rem;
	padding: 0;
}

.jssa-fest-fee-calc__result-row {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.3rem 0;
	font-size: 0.875rem;
	border-bottom: 1px solid var(--color-border, hsl(220, 15%, 88%));
}

.jssa-fest-fee-calc__result-row:last-of-type {
	border-bottom: none;
}

.jssa-fest-fee-calc__result-label {
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
}

.jssa-fest-fee-calc__result-value {
	font-weight: 600;
	justify-self: end;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.jssa-fest-fee-calc__meta {
	margin: 0 0 0.55rem;
	font-size: 0.6875rem;
	line-height: 1.5;
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
	text-align: right;
}

/* 申込リンクの上の区切りと位置 */
.jssa-fest-fee-calc__apply-wrap {
	margin-top: 0.75rem;
	padding: 0.75rem 0.65rem 0.85rem 0;
	text-align: right;
	border-top: 1px solid var(--color-border, hsl(220, 15%, 88%));
}

/* 見積もり枠の下（本文末尾・右寄せフル幅CTA） */
.jssa-fest-fee-calc__apply-wrap--footer {
	display: flex;
	justify-content: flex-end;
	width: 100%;
	margin-top: 1rem;
	padding-top: 0;
	border-top: none;
	box-sizing: border-box;
}

/* 申込リンク非表示時は区切り・余白だけが残らないようにする */
.jssa-fest-fee-calc__apply-wrap:has(.jssa-fest-fee-calc__apply[hidden]) {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.jssa-fest-fee-calc__apply-wrap--footer:has(.jssa-fest-fee-calc__apply[hidden]) {
	margin-top: 0;
}

/* 「お申し込みへ」リンクのボタン見た目 */
.jssa-fest-fee-calc__apply {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.55rem 1rem;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-accent-foreground, #fff);
	background: var(--color-primary, hsl(215, 70%, 45%));
	border-radius: var(--radius-sm, 0.25rem);
	text-decoration: none;
	transition: background 0.15s ease;
}

/* 横幅いっぱいの CTA バリエーション */
.jssa-fest-fee-calc__apply--cta {
	position: relative;
	width: 100%;
	max-width: 100%;
	justify-content: center;
	padding: 0.75rem 2.75rem 0.75rem 1rem;
	font-size: 0.9375rem;
	border-radius: 0.5rem;
	box-sizing: border-box;
}

.jssa-fest-fee-calc__apply-cta-label {
	display: block;
	flex: 1 1 auto;
	text-align: center;
	line-height: 1.35;
}

.jssa-fest-fee-calc__apply-cta-icon {
	position: absolute;
	right: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	color: inherit;
	line-height: 0;
}

.jssa-fest-fee-calc__apply-cta-icon svg {
	display: block;
}

.jssa-fest-fee-calc__apply:hover,
.jssa-fest-fee-calc__apply:focus-visible {
	background: var(--color-primary-hover, hsl(215, 70%, 40%));
	outline: 2px solid var(--color-primary, hsl(215, 70%, 45%));
	outline-offset: 2px;
}

.jssa-fest-fee-calc__apply.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.jssa-fest-fee-calc__apply.is-disabled:hover,
.jssa-fest-fee-calc__apply.is-disabled:focus-visible {
	background: var(--color-primary, hsl(215, 70%, 45%));
	outline: none;
}

.jssa-fest-fee-calc__apply[hidden] {
	display: none !important;
}

/* モーダル最下段の注意書き枠（下端 safe-area は dialog の padding に任せる） */
.jssa-fest-fee-calc__foot {
	flex-shrink: 0;
	padding: 1rem 1rem 1.15rem;
	border-top: 1px solid var(--color-border, hsl(220, 15%, 90%));
	background: var(--color-muted, hsl(220, 15%, 96%));
	border-radius: 0 0 var(--radius, 0.5rem) var(--radius, 0.5rem);
}

.jssa-fest-fee-calc__disclaimer {
	margin: 0;
	font-size: 0.6875rem;
	line-height: 1.5;
	color: var(--color-muted-foreground, hsl(220, 10%, 45%));
}

/* モーダル表示中：背面ページのスクロール停止（JS がクラス付与） */
html.jssa-fest-fee-calc--scroll-lock,
body.jssa-fest-fee-calc--scroll-lock {
	overflow: hidden;
}

/* PC・タブレット横などワイド：本文下・結果枠内の余白をさらに確保（モバイル向け調整とは別レイヤー） */
@media (min-width: 769px) {
	.jssa-fest-fee-calc__body {
		padding-bottom: 3.5rem;
	}

	.jssa-fest-fee-calc__result-panel {
		padding: 1rem 1.5rem 1.5rem;
	}

	.jssa-fest-fee-calc__apply-wrap {
		padding: 0.8rem 0.85rem 1rem 0;
	}

	.jssa-fest-fee-calc__foot {
		padding: 1.1rem 1.15rem 1.25rem;
	}
}

@media (max-width: 480px) {
	.jssa-fest-fee-calc__dialog {
		width: min(100% - 1rem, 80rem);
		max-height: min(92vh, 85rem);
		max-height: min(92dvh, 85rem);
	}

	.jssa-fest-fee-calc__head,
	.jssa-fest-fee-calc__body {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.jssa-fest-fee-calc__title {
		font-size: 1.25rem;
	}

	.jssa-fest-fee-calc__result-row {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 0.5rem;
	}

	.jssa-fest-fee-calc__result-label {
		min-width: 0;
	}

	.jssa-fest-fee-calc__result-value {
		white-space: normal;
	}
}

/* 大きめスマホ〜タブレット縦（iPad mini 縦など） */
@media (min-width: 481px) and (max-width: 768px) {
	.jssa-fest-fee-calc__dialog {
		width: min(100% - 1.5rem, 80rem);
		max-height: min(88dvh, 85rem);
	}

	.jssa-fest-fee-calc__title {
		font-size: 1.35rem;
	}

	.jssa-fest-fee-calc__head,
	.jssa-fest-fee-calc__body {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}

	.jssa-fest-fee-calc__result-row {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 0.65rem;
	}

	.jssa-fest-fee-calc__result-label {
		min-width: 0;
	}

	.jssa-fest-fee-calc__result-value {
		white-space: normal;
	}
}

/* 横向きで高さが低い端末（iPhone 横持ちなど）：モーダル高さを抑え、余白を詰める */
@media (orientation: landscape) and (max-height: 520px) {
	.jssa-fest-fee-calc__dialog {
		max-height: min(92dvh, 85rem);
		max-height: min(92svh, 85rem);
	}

	.jssa-fest-fee-calc__dialog-inner {
		max-height: min(100dvh, 80rem);
		max-height: min(100svh, 80rem);
	}

	.jssa-fest-fee-calc__head {
		padding-top: 0.65rem;
		padding-bottom: 0.65rem;
	}

	.jssa-fest-fee-calc__title {
		font-size: 1.15rem;
	}

	.jssa-fest-fee-calc__body {
		padding-top: 0.75rem;
		padding-bottom: 1.35rem;
	}
}

/* タッチ端末：入力・主要ボタンは最低 44px 近辺を確保（既存に近い値へ微調整） */
@media (pointer: coarse) {
	.jssa-fest-fee-calc__select,
	.jssa-fest-fee-calc__input {
		min-height: 2.75rem;
		padding-top: 0.55rem;
		padding-bottom: 0.55rem;
	}

	.jssa-fest-fee-calc__radio-label {
		min-height: 2.75rem;
		align-items: center;
	}

	.jssa-fest-fee-calc__apply {
		min-height: 2.75rem;
		padding-top: 0.65rem;
		padding-bottom: 0.65rem;
	}
}