/* 表の「動きを見る」と「こんなときに」（[kb_shortcuts] のあるページだけ）
 * 見た目・文言は design/demo-*.dc.html に合わせる。舞台の中のクラスは kd- で始める
 */

/* ---------- 表の中 ---------- */
.kbs-action-cell {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.kbs-action-text {
	min-width: 0;
}

/* こんなときに（demo が無い行は、補足の後ろに小さく） */
.kbs-hint {
	display: block;
	margin-top: 0.3em;
	font-size: 0.8em;
	line-height: 1.6;
	color: #6b7480;
}

.kbs-hint-label {
	margin-right: 0.6em;
	font-weight: 700;
	color: #3B4452;
}

/* 「動きを見る」ボタン（PC は操作名の右端、スマホは操作名の下） */
.kbs-demo-btn {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	height: 40px;
	margin: 0;
	padding: 0 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	color: #2A62A8;
	white-space: nowrap;
	background: #FFFFFF;
	border: 1px solid #2A62A8;
	border-radius: 20px;
	box-shadow: none;
	cursor: pointer;
}

.kbs-demo-btn:hover {
	background: #EEF3FA;
}

.kbs-demo-btn.is-open {
	color: #FFFFFF;
	background: #2A62A8;
}

.kbs-demo-btn:focus-visible,
.kbs-demo-toggle:focus-visible {
	outline: 3px solid #E8A63F;
	outline-offset: 2px;
}

.kbs-demo-btn[hidden] {
	display: none;
}

@media (max-width: 600px) {
	.kbs-action-cell {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.kbs-demo-btn {
		height: 36px;
		padding: 0 12px;
	}
}

/* カードを開く行（全幅） */
.kbs-table tbody tr.kbs-demo-row td,
.kbs-table tbody tr.kbs-demo-row:hover td {
	padding: 8px 0 28px;
	background: none;
}

/* ---------- カード ---------- */
.kbs-demo {
	display: flex;
	flex-direction: column;
	gap: 18px;
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	padding: 26px 28px;
	font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: #1C2330;
	text-align: left;
	background: #FFFFFF;
	border: 1px solid #D3D9E0;
	border-radius: 16px;
}

.kbs-demo *,
.kbs-demo *::before,
.kbs-demo *::after {
	box-sizing: border-box;
}

.kbs-demo-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
}

.kbs-demo-title {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.kbs-demo-app {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	color: #505A68;
}

.kbs-demo-action {
	font-size: 20px;
	font-weight: 900;
	line-height: 1.4;
}

.kbs-demo-keys {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.kbs-demo-plus {
	font-size: 16px;
	color: #505A68;
}

/* キーキャップ（修飾キーは黄色、それ以外は白。押されると沈む） */
.kbs-demo-key {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 12px;
	font-size: 17px;
	font-weight: 900;
	line-height: 1;
	white-space: nowrap;
	background: #FFFFFF;
	border: 1px solid #B9C2CD;
	border-bottom-width: 5px;
	border-radius: 9px;
	transition: transform 0.12s, border-bottom-width 0.12s, background-color 0.12s;
}

.kbs-demo-key.is-mod {
	min-width: 64px;
	background: #E8A63F;
	border-color: #B8812E;
}

.kbs-demo-key.is-down {
	background: #DCE2E9;
	border-bottom-width: 1px;
	transform: translateY(4px);
}

.kbs-demo-key.is-mod.is-down {
	background: #D08F2E;
}

/* 舞台（内側は幅 500px。kb-demo.js がカードの幅に合わせて縮める） */
.kbs-demo-stage {
	position: relative;
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
	overflow: hidden;
}

.kbs-demo .kd-inner {
	position: absolute;
	top: 0;
	left: 0;
	width: 500px;
	transform-origin: 0 0;
}

/* 段階の説明 */
.kbs-demo-step {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 30px;
}

.kbs-demo-badge {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 8px;
	font-size: 13px;
	font-weight: 900;
	line-height: 1;
	color: #FFFFFF;
	background: #2A62A8;
	border-radius: 15px;
}

.kbs-demo-badge.is-done {
	background: #1E7A4A;
}

.kbs-demo-caption {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
}

/* こんなときに ＋ 一時停止 */
.kbs-demo-foot {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
}

html body .kbs-demo .kbs-demo-hint {
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
	color: #3B4452;
}

.kbs-demo-hint .kbs-hint-label {
	margin-right: 1em;
	color: #1C2330;
}

.kbs-demo-toggle {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	margin: 0;
	padding: 0 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	color: #1C2330;
	background: #EEF1F4;
	border: none;
	border-radius: 10px;
	box-shadow: none;
	cursor: pointer;
}

.kbs-demo-toggle:hover {
	background: #E4E9EE;
}

@media (max-width: 600px) {
	.kbs-demo {
		gap: 14px;
		padding: 18px 16px;
	}

	.kbs-demo-action { font-size: 18px; }

	.kbs-demo-key {
		min-width: 40px;
		height: 40px;
		padding: 0 10px;
		font-size: 15px;
		border-bottom-width: 4px;
	}

	.kbs-demo-key.is-mod { min-width: 52px; }
	.kbs-demo-key.is-down { transform: translateY(3px); }
	.kbs-demo-caption { font-size: 15px; }

	.kbs-demo-foot {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
}

/* ---------- 舞台: sheet（Excel） ---------- */
.kd-sheet {
	position: relative;
	width: 500px;
	font-size: 14px;
	line-height: 1.2;
	color: #1C2330;
	background: #FFFFFF;
	border: 1px solid #C8CFD7;
	border-radius: 6px;
	overflow: hidden;
}

.kd-sheet .kd-row {
	display: grid;
	grid-template-columns: 40px 150px 160px 150px;
	height: 34px;
	border-bottom: 1px solid #E4E9EE;
}

.kd-sheet .kd-row:last-of-type { border-bottom: 0; }

.kd-sheet .kd-row--head {
	height: 30px;
	font-size: 12px;
	font-weight: 700;
	color: #505A68;
	background: #EEF1F4;
	border-bottom: 1px solid #C8CFD7;
}

.kd-sheet .kd-rh,
.kd-sheet .kd-ch {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: #505A68;
	background: #EEF1F4;
	border-right: 1px solid #C8CFD7;
	transition: background-color 0.2s;
}

.kd-sheet .kd-ch:last-child { border-right: 0; }
.kd-sheet .kd-rh.is-hi,
.kd-sheet .kd-ch.is-hi { background: #D3E7DA; }

.kd-sheet .kd-cell {
	position: relative;
	display: flex;
	align-items: center;
	min-width: 0;
	padding: 0 10px;
	white-space: pre-line;
	background: #FFFFFF;
	border-right: 1px solid #E4E9EE;
	transition: background-color 0.5s;
}

.kd-sheet .kd-cell:last-child { border-right: 0; }
.kd-sheet .kd-cell--num { justify-content: flex-end; }
.kd-sheet .kd-cell.is-b { font-weight: 700; }
.kd-sheet .kd-cell.is-in { background: #E6F1EA; }
.kd-sheet .kd-cell.is-flash { background: #FCE3B4; }
.kd-sheet .kd-cell.is-err { color: #B42318; font-weight: 700; }

.kd-sheet .kd-cell.is-two {
	font-size: 12px;
	line-height: 14px;
}

/* 入力中のカーソル */
.kd-sheet .kd-cell.is-caret .kd-cell-text::after,
.kd-caret {
	display: inline-block;
	width: 2px;
	height: 1.1em;
	margin-left: 2px;
	vertical-align: -0.15em;
	background: #1C2330;
	content: "";
	animation: kd-blink 1s steps(1) infinite;
}

@keyframes kd-blink {
	50% { opacity: 0; }
}

/* フィルターのボタン */
.kd-sheet .kd-fbtn {
	display: none;
	position: absolute;
	top: 50%;
	right: 6px;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	font-size: 11px;
	line-height: 16px;
	text-align: center;
	color: #505A68;
	background: #FFFFFF;
	border: 1px solid #B9C2CD;
	border-radius: 3px;
}

.kd-sheet .kd-cell.has-fbtn .kd-fbtn { display: block; }
.kd-sheet .kd-cell--num.has-fbtn { padding-right: 32px; }

/* 選択範囲の枠 */
.kd-sheet .kd-sel {
	position: absolute;
	border: 2px solid #217346;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}

.kd-sheet .kd-sel.is-on { opacity: 1; }

/* セルの書式設定（ダイアログ） */
.kd-sheet .kd-dialog {
	position: absolute;
	top: 22px;
	left: 110px;
	width: 280px;
	padding: 12px 14px 14px;
	font-size: 12px;
	background: #FFFFFF;
	border: 1px solid #B9C2CD;
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(28, 35, 48, 0.22);
	opacity: 0;
	transform: scale(0.94);
	transition: opacity 0.25s, transform 0.25s;
	pointer-events: none;
}

.kd-sheet .kd-dialog.is-on {
	opacity: 1;
	transform: none;
}

.kd-dialog-title { margin-bottom: 8px; font-size: 13px; font-weight: 700; }

.kd-dialog-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 8px;
	border-bottom: 1px solid #D3D9E0;
}

.kd-dialog-tabs span { padding: 4px 6px; color: #505A68; }
.kd-dialog-tabs span.is-on { font-weight: 700; color: #1C2330; border-bottom: 2px solid #217346; }

.kd-dialog-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 110px;
	padding: 4px;
	border: 1px solid #D3D9E0;
}

.kd-dialog-body span { padding: 2px 6px; }
.kd-dialog-body span.is-on { color: #FFFFFF; background: #217346; }

/* ---------- 舞台: doc（Word） ---------- */
.kd-doc {
	position: relative;
	height: 204px;
	padding-top: 16px;
	overflow: hidden;
	background: #E4E9EE;
	border-radius: 6px;
}

.kd-doc .kd-desk {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.kd-doc .kd-page {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 380px;
	min-height: 230px;
	padding: 26px 34px;
	background: #FFFFFF;
	box-shadow: 0 1px 3px rgba(28, 35, 48, 0.18);
}

.kd-doc .kd-page--2 { display: none; }
.kd-doc .kd-page--2.is-on { display: flex; }

.kd-doc .kd-title-line {
	position: relative;
	height: 30px;
}

.kd-doc .kd-title {
	position: absolute;
	top: 0;
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding: 0 4px;
	font-size: 18px;
	line-height: 1;
	white-space: nowrap;
	transition: left 0.55s cubic-bezier(0.3, 0.7, 0.2, 1), transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1), background-color 0.2s, font-size 0.3s;
}

.kd-doc .kd-title--left { left: 0; transform: translateX(0); }
.kd-doc .kd-title--center { left: 50%; transform: translateX(-50%); }
.kd-doc .kd-title--right { left: 100%; transform: translateX(-100%); }
.kd-doc .kd-title.is-sel { background: #CFE0F5; }
.kd-doc .kd-title.is-flash { background: #FCE3B4; }
.kd-doc .kd-title .kd-caret { height: 20px; transition: opacity 0.1s; }

.kd-doc .kd-lines {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.kd-doc .kd-bar {
	display: block;
	height: 9px;
	background: #DCE2E9;
	border-radius: 4px;
}

.kd-doc .kd-bar-wrap {
	display: flex;
	align-items: center;
}

.kd-doc .kd-bar-wrap .kd-bar { flex: 0 0 auto; }
.kd-doc .kd-bar-wrap .kd-caret { height: 14px; margin-left: 3px; }

.kd-doc .kd-text {
	display: block;
	font-size: 13px;
	line-height: 1.3;
	white-space: nowrap;
}

.kd-doc .kd-text--indent { padding-left: 1em; min-height: 1.3em; }

.kd-doc .is-sel { background-color: #CFE0F5; }
.kd-doc .kd-bar.is-sel { background: #9DBCE3; }

/* ---------- 舞台: slide（PowerPoint） ---------- */
.kd-slides {
	position: relative;
	height: 204px;
	overflow: hidden;
	background: #E4E9EE;
	border-radius: 6px;
}

.kd-slides .kd-thumbs {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	width: 88px;
}

.kd-slides .kd-thumb {
	display: flex;
	align-items: center;
	gap: 5px;
}

.kd-slides .kd-thumb[hidden] { display: none; }

.kd-slides .kd-thumb-no {
	width: 10px;
	font-size: 10px;
	font-weight: 700;
	color: #505A68;
	text-align: right;
}

.kd-slides .kd-mini {
	position: relative;
	width: 70px;
	height: 39px;
	background: #FFFFFF;
	border: 2px solid transparent;
	border-radius: 2px;
	box-shadow: 0 0 0 1px #C8CFD7;
	transition: background-color 0.4s, border-color 0.2s;
}

.kd-slides .kd-thumb.is-sel .kd-mini { border-color: #C43E1C; box-shadow: none; }
.kd-slides .kd-thumb.is-flash .kd-mini { background: #FCE3B4; }

.kd-mini-bar { position: absolute; top: 7px; left: 8px; width: 40px; height: 5px; background: #505A68; border-radius: 2px; }
.kd-mini--title .kd-mini-bar { top: 15px; left: 13px; }
.kd-mini-rect { position: absolute; top: 18px; left: 12px; width: 16px; height: 11px; background: #2A62A8; }
.kd-mini-dot { position: absolute; top: 18px; left: 34px; width: 11px; height: 11px; background: #E8A63F; border-radius: 50%; }
.kd-mini-ph { position: absolute; top: 6px; left: 7px; width: 52px; height: 8px; border: 1px dashed #9AA4B1; }
.kd-mini-ph--2 { top: 18px; height: 12px; }

.kd-slides .kd-main {
	position: absolute;
	top: 8px;
	left: 124px;
	width: 336px;
	height: 189px;
	background: #FFFFFF;
	box-shadow: 0 1px 3px rgba(28, 35, 48, 0.18);
	transform-origin: 0 0;
	transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
	z-index: 2;
}

.kd-slides .kd-ttl {
	position: absolute;
	top: 18px;
	left: 20px;
	width: 296px;
	height: 40px;
	display: flex;
	align-items: center;
	padding: 0 8px;
	border: 1px dashed transparent;
}

.kd-slides .kd-ttl.is-sel { border-color: #7A8594; }
.kd-slides .kd-ttl--center { justify-content: center; }

.kd-slides .kd-ttl-text {
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	transition: font-size 0.3s;
}

.kd-slides .kd-shape {
	position: absolute;
	top: 82px;
	outline: 2px solid transparent;
	outline-offset: 3px;
	transition: opacity 0.3s, transform 0.4s;
}

.kd-slides .kd-shape.is-sel { outline-color: #7A8594; }
.kd-slides .kd-rect { left: 64px; width: 88px; height: 58px; background: #2A62A8; border-radius: 4px; }
.kd-slides .kd-circle { left: 196px; width: 60px; height: 60px; background: #E8A63F; border-radius: 50%; }

.kd-slides .kd-copy {
	opacity: 0;
	transform: translate(0, 0);
}

.kd-slides .kd-copy.is-on {
	opacity: 1;
	transform: translate(20px, 20px);
}

.kd-slides .kd-group {
	position: absolute;
	top: 76px;
	left: 58px;
	width: 204px;
	height: 72px;
	border: 2px solid #7A8594;
	opacity: 0;
	transition: opacity 0.2s;
}

.kd-slides .kd-group.is-on { opacity: 1; }

/* 新しいスライド（空のレイアウト） */
.kd-slides .kd-ph {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	font-size: 12px;
	color: #7A8594;
}

.kd-ph-title,
.kd-ph-body {
	display: flex;
	align-items: center;
	padding: 0 10px;
	border: 1px dashed #9AA4B1;
}

.kd-ph-title { height: 40px; font-size: 15px; }
.kd-ph-body { flex: 1; align-items: flex-start; padding-top: 8px; }

/* 表紙（1枚目）: 図形を出さず、タイトルを真ん中に */
.kd-slides .kd-main.is-title .kd-shape,
.kd-slides .kd-main.is-title .kd-group { display: none; }
.kd-slides .kd-main.is-title .kd-ttl { top: 74px; justify-content: center; }
.kd-slides .kd-main.is-title .kd-ttl-text { font-size: 22px !important; }

.kd-slides .kd-main.is-blank .kd-ph { display: flex; }
.kd-slides .kd-main.is-blank > :not(.kd-ph) { display: none; }

/* スライドショー（全画面）・黒い画面 */
.kd-slides .kd-backdrop,
.kd-slides .kd-black {
	position: absolute;
	inset: 0;
	background: #000000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s;
}

.kd-slides .kd-backdrop { z-index: 1; }
.kd-slides .kd-black { z-index: 3; }
.kd-slides.is-show .kd-backdrop { opacity: 1; }
.kd-slides.is-black .kd-black { opacity: 1; }
.kd-slides.is-show .kd-main { transform: translate(-54px, -8px) scale(1.0794); box-shadow: none; }
.kd-slides.is-show .is-sel,
.kd-slides.is-show .kd-group { outline-color: transparent; border-color: transparent; }

/* 動きを減らす設定のときは、アニメーションしない（完了後の状態を見せる） */
@media (prefers-reduced-motion: reduce) {
	.kbs-demo *,
	.kbs-demo *::after {
		transition: none !important;
		animation: none !important;
	}
}
