/* =========================================================
 * present.css … プロジェクター表示（/present/）と印刷ページ（/print1/）
 *   スライドの見た目（.pz-slide）は、表示・見本・PDF で共通
 * ========================================================= */

/* ---------------------------------------------------------
 * スライド（基準の大きさ：幅 1600px。表示するときに縮める）
 * --------------------------------------------------------- */
.pz-slide {
	position: absolute;
	top: 0;
	left: 0;
	box-sizing: border-box;
	overflow: hidden;
	transform-origin: 0 0;
	text-align: center;
	line-height: 1.3;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}
.pz-theme-white { background: #fff; color: #000; }
.pz-theme-black { background: #000; color: #fff; }

.pz-head {
	position: absolute;
	top: 30px;
	left: 60px;
	right: 60px;
	height: 50px;
	line-height: 50px;
	font-size: 28px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #555;
}
.pz-theme-black .pz-head { color: #bbb; }

.pz-body {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pz-inner {
	display: inline-block;
	white-space: pre;
	line-height: 1.3;
	text-align: center;
}
.pz-group + .pz-group { margin-top: .25em; }
.pz-line { white-space: pre; }
.pz-hira,
.pz-roma { font-size: .8em; color: #6b6b6b; }
.pz-theme-black .pz-hira,
.pz-theme-black .pz-roma { color: #b5b5b5; }
.pz-chord { font-size: .8em; }   /* 色は本文と同じ */

.pz-num {
	position: absolute;
	right: 40px;
	bottom: 20px;
	height: 50px;
	line-height: 50px;
	font-size: 24px;
	color: #888;
}

/* 測るための見えない箱 */
.pz-meter {
	position: absolute;
	left: -100000px;
	top: 0;
	visibility: hidden;
	pointer-events: none;
}

/* 縮めて置くための箱 */
.pz-fit {
	position: relative;
	overflow: hidden;
	margin: 0 auto;
}
.pz-box { position: relative; }
.pz-box.is-black .pz-fit::after,
.pz-stage.is-black .pz-fit::after {
	content: "";
	position: absolute;
	inset: 0;
	background: #000;
}


/* ---------------------------------------------------------
 * 印刷・PDF（印刷の間だけ、ほかのものを隠す）
 * --------------------------------------------------------- */
@media screen {
	#sanbi-print-root { position: absolute; left: -100000px; top: 0; }
}
@media print {
	html.sanbi-printing body > *:not(#sanbi-print-root) { display: none !important; }
	html.sanbi-printing,
	html.sanbi-printing body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
	html.sanbi-printing #sanbi-print-root { position: static; }
}
.pz-print-page {
	position: relative;
	overflow: hidden;
	break-after: page;
	page-break-after: always;
}
.pz-print-page:last-child { break-after: auto; page-break-after: auto; }


/* ---------------------------------------------------------
 * 操作パネル（/present/）
 * --------------------------------------------------------- */
body.sanbi-present { margin: 0; background: #f3f4f6; color: #222; font-family: system-ui, -apple-system, "Hiragino Sans", "Meiryo", sans-serif; }
body.sanbi-present.is-screen { background: #000; overflow: hidden; }
html:fullscreen body.sanbi-present.is-screen { cursor: none; }
.pz-app { min-height: 100vh; display: flex; flex-direction: column; }
.pz-btn {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #c8c8c8;
	border-radius: 6px;
	background: #fff;
	color: #222;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}
.pz-btn:hover { background: #f7f7f7; }
.pz-btn[hidden] { display: none; }
.pz-btn:disabled { opacity: .6; cursor: default; }
.pz-btn--main { background: #d4792d; border-color: #d4792d; color: #fff; font-weight: bold; }
.pz-btn--main:hover { background: #c06a22; }
.pz-btn--big { font-size: 18px; padding: 10px 22px; }
.pz-btn.is-on { background: #222; color: #fff; border-color: #222; }

.pz-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 16px;
	background: #fff;
	border-bottom: 1px solid #e3e3e3;
}
.pz-bar__title { font-weight: bold; font-size: 17px; }
.pz-bar__buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.pz-settings {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	padding: 8px 16px;
	background: #fafafa;
	border-bottom: 1px solid #e3e3e3;
	font-size: 14px;
}
.pz-settings select { font-size: 14px; padding: 2px 4px; }

.pz-note { margin: 10px 16px 0; padding: 8px 12px; background: #fff8e5; border-left: 4px solid #dba617; font-size: 14px; }
.pz-note .pz-btn { margin-left: 8px; padding: 2px 10px; font-size: 13px; }

.pz-main { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.pz-side { flex: 0 0 340px; max-width: 340px; background: #fff; border: 1px solid #e3e3e3; border-radius: 8px; padding: 12px; box-sizing: border-box; }
.pz-center { flex: 1; min-width: 0; }
.pz-h { font-size: 15px; margin: 4px 0 10px; }
.pz-h small { font-weight: normal; color: #888; font-size: 12px; }

.pz-songs { list-style: none; margin: 0; padding: 0; }
.pz-song { display: flex; gap: 6px; padding: 8px 6px; border: 1px solid #e5e5e5; border-radius: 6px; margin-bottom: 6px; background: #fff; }
.pz-song.is-current { border-color: #d4792d; background: #fff8f1; }
.pz-handle { cursor: grab; color: #999; font-size: 18px; line-height: 1.3; user-select: none; padding: 0 2px; }
.pz-song__main { flex: 1; min-width: 0; }
.pz-song__title { all: unset; cursor: pointer; font-weight: bold; font-size: 14px; line-height: 1.4; }
.pz-song__title:hover { text-decoration: underline; }
.pz-song__label { font-size: 12px; color: #888; margin: 2px 0 4px; }
.pz-song__ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.pz-key { font-size: 12px; padding: 1px 2px; }
.pz-modes { display: inline-flex; }
.pz-modes button { padding: 2px 8px; border: 1px solid #ccc; background: #fff; font-size: 12px; cursor: pointer; margin-left: -1px; }
.pz-modes button:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.pz-modes button:last-child { border-radius: 0 4px 4px 0; }
.pz-modes button.is-active { background: #d4792d; border-color: #d4792d; color: #fff; font-weight: bold; }
.pz-del { padding: 2px 8px; border: 1px solid #e0b4b4; border-radius: 4px; background: #fff; color: #b32d2e; font-size: 12px; cursor: pointer; }
.pz-layers { margin-top: 6px; font-size: 12px; }
.pz-layers summary { cursor: pointer; color: #555; }
.pz-layers__row { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 4px 0; border-bottom: 1px dashed #eee; }
.pz-layers__row label { white-space: nowrap; cursor: pointer; }

.pz-add { margin-top: 12px; }
.pz-add__row { display: flex; gap: 6px; }
.pz-add__row input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px; }
.pz-add__list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow: auto; }
.pz-add__list li { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.pz-add__list .pz-btn { padding: 2px 10px; font-size: 12px; }
.pz-add__msg { color: #888; }

.pz-stagebox { display: flex; gap: 16px; align-items: flex-start; }
.pz-now { flex: 3; min-width: 0; }
.pz-next { flex: 2; min-width: 0; }
.pz-cap { font-size: 13px; color: #666; margin-bottom: 4px; }
.pz-now .pz-box, .pz-next .pz-box { width: 100%; aspect-ratio: 16 / 9; background: #ddd; border-radius: 4px; overflow: hidden; }
.pz-now .pz-box .pz-fit, .pz-next .pz-box .pz-fit { box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pz-end { display: flex; align-items: center; justify-content: center; height: 100%; color: #888; font-size: 14px; }

.pz-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 4px; }
.pz-jump { font-size: 14px; }
.pz-jump input { width: 4.5em; padding: 4px; font-size: 14px; }
.pz-help { font-size: 12px; color: #888; margin: 4px 0 16px; }

.pz-thumbs { max-height: 48vh; overflow: auto; background: #fff; border: 1px solid #e3e3e3; border-radius: 8px; padding: 8px 12px; }
.pz-thumbs__song { font-size: 13px; font-weight: bold; margin: 8px 0 4px; }
.pz-thumbs__row { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-thumb { position: relative; width: 168px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: #ddd; cursor: pointer; }
.pz-thumb .pz-box { width: 100%; aspect-ratio: 16 / 9; }
.pz-thumb.is-current { border-color: #d4792d; }
.pz-thumb__n { position: absolute; left: 3px; top: 2px; z-index: 2; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 0 5px; border-radius: 3px; }
.pz-empty { color: #888; font-size: 14px; }

/* 複製：全画面のステージ */
.pz-stage { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: #000; cursor: none; }
.pz-stage[hidden] { display: none; }
.pz-stage .pz-fit { margin: auto; }

/* 拡張：表示だけの画面 */
.pz-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.pz-screen .pz-fit { margin: auto; }
body.is-screen.is-black .pz-screen { visibility: hidden; }
.pz-screen-hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 18px; background: rgba(0,0,0,.7); color: #fff; border-radius: 8px; font-size: 16px; text-align: center; z-index: 5; }
.pz-screen-hint[hidden] { display: none; }

@media (max-width: 900px) {
	.pz-main { flex-direction: column; }
	.pz-side { flex: none; max-width: none; width: 100%; }
	.pz-stagebox { flex-direction: column; }
	.pz-now, .pz-next { width: 100%; }
}


/* ---------------------------------------------------------
 * 印刷ページ（/print1/）
 * --------------------------------------------------------- */
.pp-app { margin: 1em 0 2em; }
.pp-form { background: #f7f7f7; border: 1px solid #e5e5e5; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.pp-form__row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 4px 0; font-size: 14px; }
.pp-form__row label { white-space: nowrap; }
.pp-form select { font-size: 14px; padding: 2px 4px; }
.pp-kind { display: flex; gap: 0; margin-bottom: 10px; }
.pp-kind button { flex: 1; max-width: 200px; padding: 8px 10px; border: 1px solid #ccc; background: #fff; font-size: 14px; cursor: pointer; margin-left: -1px; }
.pp-kind button:first-child { margin-left: 0; border-radius: 6px 0 0 6px; }
.pp-kind button:last-child { border-radius: 0 6px 6px 0; }
.pp-kind button.is-active { background: #d4792d; border-color: #d4792d; color: #fff; font-weight: bold; }
.pp-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.pp-actions .pz-btn { font-size: 15px; padding: 8px 18px; }
.pp-msg { font-size: 13px; color: #666; }
.pp-preview-cap { font-size: 13px; color: #666; margin: 6px 0; }
.pp-preview { background: #e9eaec; border-radius: 8px; padding: 12px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-height: 80vh; overflow: auto; }
.pp-preview .pz-box { box-shadow: 0 1px 4px rgba(0,0,0,.2); background: #fff; }
.pp-preview-item { position: relative; padding-top: 20px; }
.pp-preview-item__n { position: absolute; left: 0; top: 0; z-index: 2; font-size: 11px; background: rgba(0,0,0,.5); color: #fff; padding: 0 5px; border-radius: 3px; }

/* 紙の1ページ（基準：1mm = 1mm。見本では縮める） */
.pp-page {
	position: absolute;
	top: 0;
	left: 0;
	box-sizing: border-box;
	background: #fff;
	color: #000;
	transform-origin: 0 0;
	overflow: hidden;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}
#sanbi-print-root .pp-page { position: relative; transform: none !important; break-after: page; page-break-after: always; }
#sanbi-print-root .pp-page:last-child { break-after: auto; page-break-after: auto; }
.pp-cols { display: flex; height: 100%; }
.pp-col { flex: 1; min-width: 0; height: 100%; overflow: hidden; }
.pp-chunk { padding: 0 0 .6em; }
.pp-chunk + .pp-chunk { border-top: 1px solid #999; padding-top: .6em; }
.pp-title { font-weight: bold; margin-bottom: .35em; }
.pp-cont { font-weight: normal; font-size: .85em; color: #555; }
.pp-body { line-height: 1.5; }
.pp-group { margin-bottom: .2em; }
.pp-line { white-space: pre-wrap; word-break: break-word; }
.pp-chord { color: #000; font-weight: 600; }
.pp-hira,
.pp-roma { font-size: .85em; color: #444; }
.pp-blank { height: .7em; }
.pp-label { float: right; margin-left: 1em; font-size: .75em; font-weight: normal; color: #999; line-height: 1.9; }
.pp-legend { font-size: .75em; color: #888; line-height: 1.6; }
.pp-meter { position: absolute; left: -100000px; top: 0; visibility: hidden; }
.pz-stage.is-black,
body.is-screen.is-black { background: #000 !important; }

/* ヘッダー・フッター（紙の上と下） */
.pp-hf { position: absolute; color: #555; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.pp-hf--3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.pp-hf__l { text-align: left; overflow: hidden; }
.pp-hf__c { text-align: center; overflow: hidden; }
.pp-hf__r { text-align: right; overflow: hidden; }
.pp-hf-form { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #ddd; font-size: 14px; }
.pp-hf-form summary { cursor: pointer; font-weight: bold; margin-bottom: 4px; }
.pp-hf-form small { color: #777; }
.pp-hf-sub { padding-left: 1em; }
