/*
 * 自社サイトからの導線（ヒーローボタン・ヒーロー直下バナー・右下固定バナー・チャットボットの吹き出し）
 * 特設ページと同じ黄色とネイビーで揃える。
 * テーマの CSS の中で表示されるため、色・余白・文字の指定は省略せずに書く。
 * 文字はサイトが読み込み済みの Noto Sans JP（400 / 600）を使い、このためだけのフォント読み込みは増やさない。
 */

.msd-hero-btn,
.msd-hero-banner,
.msd-float {
	--msd-navy: #103042;
	--msd-yellow: #ffd500;
	box-sizing: border-box;
	font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
	letter-spacing: 0.04em;
}

.msd-hero-btn *,
.msd-hero-banner *,
.msd-float * {
	box-sizing: border-box;
}

.msd-hero-btn .msd-icon,
.msd-hero-banner .msd-icon,
.msd-float .msd-icon {
	width: 1em;
	height: 1em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.msd-icon--image {
	display: inline-block;
	background-color: currentColor;
	-webkit-mask: var(--msd-icon) center / contain no-repeat;
	mask: var(--msd-icon) center / contain no-repeat;
}

/* ---------- ヒーローボタン ---------- */

.msd-hero-btn {
	display: inline-flex;
	align-self: center; /* テーマのヒーロー（.content）は縦並びの flex なので、横いっぱいに伸びないようにする */
	align-items: center;
	gap: 10px;
	width: fit-content;
	margin-top: 40px;
	padding: 14px 28px 14px 24px;
	border-radius: 999px;
	background: var(--msd-yellow);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	color: var(--msd-navy) !important;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none !important;
	text-shadow: none;
	pointer-events: auto;
	transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

/* テーマがヒーローの文字を出す合図（.start_slide）に合わせて、文字より少し遅れて出す */
#header_slider_wrap:not(.start_slide) .msd-hero-btn {
	opacity: 0;
}

#header_slider_wrap.start_slide .msd-hero-btn {
	animation: msd-fade-up 0.8s ease 0.6s backwards;
}

.msd-hero-btn:hover {
	background: var(--msd-navy);
	color: var(--msd-yellow) !important;
	transform: translateY(-2px);
}

.msd-hero-btn .msd-icon:first-child {
	font-size: 22px;
}

/* 「【特設】」：このボタンが特設ページへの入口だと、最初に伝わるようにする */
.msd-hero-btn__tag {
	font-weight: 800;
	letter-spacing: 0.02em;
}

.msd-hero-btn .msd-icon:last-child {
	font-size: 16px;
	stroke-width: 3;
}

@keyframes msd-fade-up {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- ヒーロー直下バナー ---------- */

/* 吹き出しは帯の外（overflow: hidden の外）に出すので、帯を包む枠を置く */
.msd-hero-banner-wrap {
	--msd-navy: #103042;
	position: relative;
	z-index: 20;
}

/* 帯の左上の吹き出し（白・下向きのしっぽ）。帯の中身と同じ幅の枠の左端、犬の真上に合わせる */
.msd-hero-say {
	position: absolute;
	bottom: calc(100% + 16px);
	left: max(24px, calc((100% - 1120px) / 2 + 24px));
	display: grid;
	gap: 1px;
	width: max-content;
	max-width: calc(100vw - 48px);
	margin: 0;
	padding: 0.55em 1.2em 0.65em;
	border: 2px solid var(--msd-navy);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
	color: var(--msd-navy);
	font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1.5;
	pointer-events: none;
	text-align: left;
}

.msd-hero-say b {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.4;
}

.msd-hero-say::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 34px;
	width: 14px;
	height: 14px;
	margin-top: -8px;
	border-right: 2px solid var(--msd-navy);
	border-bottom: 2px solid var(--msd-navy);
	background: #fff;
	transform: rotate(45deg);
}

.msd-hero-banner {
	position: relative;
	overflow: hidden;
	background: var(--msd-yellow);
}

.msd-hero-banner__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1120px;
	margin: 0 auto;
	padding: 18px 24px;
	color: var(--msd-navy) !important;
	text-decoration: none !important;
}

.msd-hero-banner__mascot {
	flex: none;
	width: 84px;
	height: auto;
	margin: 0 0 -24px;
}

.msd-hero-banner__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-right: auto;
}

.msd-hero-banner__lead {
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6;
}

.msd-hero-banner__title {
	font-size: 26px;
	font-weight: 600;
	line-height: 1.45;
}

/* 狭い画面でも「開設しました」の途中で折り返さない */
.msd-hero-banner__title span {
	display: inline-block;
}

.msd-hero-banner__btn {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 6px;
	padding: 12px 26px;
	border-radius: 999px;
	background: var(--msd-navy);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	transition: transform 0.2s;
}

.msd-hero-banner__btn .msd-icon {
	color: var(--msd-yellow);
	stroke-width: 3;
}

.msd-hero-banner__link:hover .msd-hero-banner__btn {
	transform: translateX(4px);
}

/* ---------- 右下固定バナー（PCのみ） ----------
 * 既存の「トップへ戻る」（右下 65px）と、画面下端を左右に歩くチャットボットに重ならないよう、下から 190px に置く。
 * チャットボットは最大 46px 跳ねるので、吹き出しの上端は画面下から 178px まで届く（96 + 8 + 46 + 吹き出し 28）。
 * 犬はカードの上に少しはみ出させる。
 */

.msd-float {
	position: fixed;
	right: 30px;
	bottom: 190px;
	z-index: 9990;
	width: 248px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.msd-float.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.msd-float__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	border: 2.5px solid var(--msd-navy);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(16, 48, 66, 0.22);
	color: var(--msd-navy) !important;
	text-align: center;
	text-decoration: none !important;
	transition: transform 0.2s;
}

.msd-float__link:hover {
	transform: translateY(-2px);
}

.msd-float__visual {
	display: block;
	margin: -46px 0 4px;
}

.msd-float__visual img {
	display: block;
	width: auto;
	height: 96px;
}

.msd-float__lead {
	padding: 0 16px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
}

.msd-float__title {
	padding: 2px 16px 14px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.5;
}

.msd-float__tag {
	display: block;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.4;
}

.msd-float__bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 12px 16px;
	border-top: 2.5px solid var(--msd-navy);
	border-radius: 0 0 15px 15px;
	background: var(--msd-yellow);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.msd-float__bar .msd-icon {
	stroke-width: 3;
}

.msd-float__close {
	position: absolute;
	top: -12px;
	right: -12px;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--msd-navy);
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.msd-float__close:hover {
	background: #000;
}

/* ---------- チャットボットの吹き出しに混ぜる案内（スマホ） ----------
 * 吹き出しそのものは既存チャットボットの見た目のまま。案内のときだけ文字色を変え、画面幅を超えるときは折り返す。
 */

#bdp-dify-root .bdp-open-bubble.msd-bubble {
	max-width: calc(100vw - 140px);
	color: #103042;
	white-space: normal;
	cursor: pointer;
}

/* ---------- 高さの足りない画面 ----------
 * 固定バナー（犬のはみ出しを含めて約 230px）と下の余白、テーマのヘッダー（80px）が収まらないときは出さない。
 */

@media (max-height: 520px) {
	.msd-float {
		display: none !important;
	}
}

/* ---------- タブレット・スマホ ---------- */

@media (max-width: 1023px) {
	/* スマホは固定バナーを出さず、チャットボットの吹き出しで訴求する（要件） */
	.msd-float {
		display: none !important;
	}

	.msd-hero-banner__title {
		font-size: 21px;
	}
}

@media (max-width: 767px) {
	.msd-hero-say {
		bottom: calc(100% + 14px);
		left: 16px;
		max-width: calc(100vw - 32px);
		padding: 0.5em 1em 0.6em;
		font-size: 12px;
	}

	.msd-hero-say b {
		font-size: 16px;
	}

	.msd-hero-say::after {
		left: 28px;
	}

	.msd-hero-btn {
		gap: 8px;
		margin-top: 28px;
		padding: 12px 20px 12px 18px;
		font-size: 14px;
	}

	.msd-hero-btn .msd-icon:first-child {
		font-size: 18px;
	}

	.msd-hero-banner__link {
		flex-wrap: wrap;
		gap: 10px 14px;
		padding: 16px 20px;
	}

	.msd-hero-banner__mascot {
		width: 56px;
		margin: 0;
	}

	.msd-hero-banner__body {
		flex: 1 1 0;
		min-width: 0;
		margin-right: 0;
	}

	.msd-hero-banner__lead {
		font-size: 12px;
	}

	.msd-hero-banner__title {
		font-size: 16px;
	}

	.msd-hero-banner__btn {
		justify-content: center;
		width: 100%;
		padding: 10px 24px;
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#header_slider_wrap.start_slide .msd-hero-btn {
		animation: none;
	}

	.msd-float {
		transition: none;
	}
}
