/* PC 幅ではメディアクエリ内のスタイルが外れるため、hidden を全幅で効かせる（SP→PC 切り替え時の露出防止） */
.colBar[hidden],
.colBarSheet[hidden],
.colBarShade[hidden] {
	display: none;
}

@media only screen and (max-width: 999px) {
	.colBar {
		position: fixed;
		z-index: 150;
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		align-items: stretch;
		gap: 8px;
		padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
		border-top: 1px solid #d8eee3;
		background: #fff;
		box-shadow: 0 -4px 14px rgba(0, 0, 0, .08);
		font-family: "Noto Sans JP", sans-serif;
		transform: translateY(100%);
		transition: transform .2s ease;
	}

	/* display:flex が hidden 属性を上書きするため明示する（画面外の影がはみ出さないように） */
	.colBar[hidden] {
		display: none;
	}

	.colBar.is-visible {
		transform: translateY(0);
	}

	.colBar__toc {
		display: flex;
		flex: 0 0 56px;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 56px;
		padding: 0;
		border: 1px solid #7dcfa9;
		border-radius: 8px;
		background: #fff;
		color: #2e9c6a;
		font-size: 13px;
		font-weight: 700;
		line-height: 1.2;
	}

	.colBar__icon {
		font-size: 17px;
	}

	.colBar__cta {
		display: flex;
		min-width: 0;
		flex: 1;
		align-items: center;
		padding: 6px 12px;
		border-radius: 8px;
		background: #46b481;
		color: #fff;
		text-decoration: none;
	}

	/* common.css の a:link / a:visited（下線・#333）が詳細度で勝つため、リンクの状態ごとに上書きする */
	.colBar a.colBar__cta:link,
	.colBar a.colBar__cta:visited,
	.colBar a.colBar__cta:hover {
		color: #fff;
		text-decoration: none;
	}

	.colBarSheet__list a:link,
	.colBarSheet__list a:visited,
	.colBarSheet__list a:hover {
		color: inherit;
		text-decoration: none;
	}

	.colBar__text {
		min-width: 0;
	}

	.colBar__kicker {
		display: block;
		font-size: 10.5px;
		font-weight: 500;
		opacity: .9;
	}

	.colBar__name {
		display: block;
		overflow: hidden;
		font-size: 14px;
		font-weight: 700;
		line-height: 1.35;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.colBar__arrow {
		margin-left: auto;
		padding-left: 6px;
		font-size: 18px;
	}

	.colBar[data-has-toc="0"] .colBar__toc {
		display: none;
	}

	.colBarShade {
		position: fixed;
		z-index: 299;
		inset: 0;
		background: rgba(0, 0, 0, .35);
		opacity: 0;
		transition: opacity .2s ease;
	}

	.colBarShade.is-open {
		opacity: 1;
	}

	.colBarSheet {
		position: fixed;
		z-index: 300;
		right: 0;
		bottom: 0;
		left: 0;
		max-height: 75vh;
		overflow-y: auto;
		padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
		border-radius: 16px 16px 0 0;
		background: #fff;
		box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
		font-family: "Noto Sans JP", sans-serif;
		transform: translateY(100%);
		transition: transform .2s ease;
	}

	.colBarSheet.is-open {
		transform: translateY(0);
	}

	.colBarSheet__hd {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 6px;
		padding-bottom: 10px;
		border-bottom: 1px solid #e3f2ea;
		color: #2e9c6a;
		font-size: 15px;
		font-weight: 700;
	}

	.colBarSheet__close {
		padding: 4px;
		border: 0;
		background: transparent;
		color: #555;
		font-size: 12px;
	}

	.colBarSheet__list {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.colBarSheet__list li {
		padding: 8px 0;
		border-bottom: 1px dashed #e6e6e6;
		color: #333;
		font-size: 13.5px;
		line-height: 1.5;
	}

	.colBarSheet__list li.is-sub {
		padding-left: 16px;
		color: #555;
		font-size: 12.5px;
	}

	.colBarSheet__list li.is-current {
		margin: 0 -8px;
		padding-left: 8px;
		background: #effaf4;
		color: #2e9c6a;
		font-weight: 700;
	}

	.colBarSheet__list li.is-current.is-sub {
		padding-left: 24px;
	}

	.colBarSheet__list a {
		display: block;
		color: inherit;
		text-decoration: none;
	}

	/* 目次シートを開いている間だけ背景のスクロールを止める（body の style 属性は触らない） */
	body.colBarLocked {
		overflow: hidden;
	}

	body.has-colBar #btnPagetop {
		bottom: calc(80px + env(safe-area-inset-bottom));
	}
}
