@charset "UTF-8";
/*
 * シノビガミ シナリオシート編集画面の狭い画面（スマートフォンなど）向けの調整
 * PCでの見た目は scenario.css のまま。edit-responsive.css より後に読み込むこと。
 * 項目名は縦書きにならないよう折り返さず、入力欄を狭めて画面幅に収め、横スクロールを出さない。
 */
@media (max-width: 840px) {
	/* 項目名は1行で表示する */
	#chForm th.item {
		white-space: nowrap;
		padding: 1px 3px;
	}

	/* 表は横スクロールさせず画面幅に収める */
	#chForm table {
		display: table !important;
		width: 100% !important;
		overflow: visible !important;
	}
	#chForm td.input {
		min-width: 0;
	}
	#chForm td.input input[type=text], #chForm td.input textarea {
		width: 100% !important;
		min-width: 0;
		box-sizing: border-box;
	}
	#chForm td.input input.basenum {
		width: 4em !important;
	}
	/* キャラクターリンクの表示欄は長いURLでも折り返す */
	[id^="characters."][id$=".url"] {
		width: auto !important;
		overflow-wrap: anywhere;
	}

	/*
	 * 基本情報：表の行をCSSグリッドに置き換え、「項目名・入力欄」を1組ずつ並べる。
	 */
	#base {
		display: block !important;
	}
	#base > tbody {
		display: grid;
		grid-template-columns: max-content minmax(0, 1fr);
		border-top: 1px solid #000;
		border-left: 1px solid #000;
	}
	#base > tbody > tr {
		display: contents;
	}
	#base th, #base td {
		border: 0;
		border-right: 1px solid #000;
		border-bottom: 1px solid #000;
	}
	#base th {
		display: flex;
		align-items: center;
		justify-content: center;
	}
	#base td {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0 2px;
	}
	/* 秘匿情報閲覧パスの行：項目名と入力欄を1行ずつ、閲覧ボタンと公開中を最後の行に並べる */
	#base th[colspan="2"] {
		grid-column: 1 / -1;
	}
	#base td:has(> [id="secret.pass"]) {
		grid-column: 1 / -1;
	}
	#base td:has(> #openButton), #base td.item {
		justify-content: center;
	}

	/* 説明のタイトル欄：コピーボタンを表示したときは入力欄を縮めて、ボタンを同じ行に並べる */
	#chForm td.input:has(> .copybutton) {
		width: 100%;
		display: flex;
		align-items: center;
		gap: 2px;
	}
	#chForm td.input:has(> .copybutton) > input[type=text] {
		flex: 1 1 0;
		width: 0 !important;
	}
	/* タイトル以外の列（項目名・秘・行の操作ボタン）は中身の幅だけにする */
	#summary table tr:first-child > :not(:has(> .copybutton)) {
		width: 1%;
	}
	#chForm td.input > input.copybutton {
		flex: none;
	}
}
