td {
	text-align : center;
}

textarea {
	overflow-y : auto;
}

.baseinput {
	width : 126px;
}

.baseinput2 {
	width : 160px;
}

.baseinput3 {
	width : 200px;
}

.baseshort {
	width : 50px;
	text-align: center;
}

#div\.status, #div\.ability {
	margin-right: 4px;
}

#ability input[type=text],
.abilityCalc input[type=text] {
	width : 60px;
	height : 30px;
	font-size : 16pt;
	text-align : center;
}

#ability .sublimation {
	white-space : nowrap;
}

#bonds .name {
	width : 150px;
}

#bonds .emotion {
	width : 120px;
}

#div\.skills, #div\.items, #div\.ghost {
	margin-top : 4px;
}

#skills .name, #items .name {
	width : 120px;
}

#skills .type, #items .type {
	width : 60px;
}

#skills .timing, #items .timing {
	width : 80px;
}

#skills .target, #items .judge {
	width : 60px;
}

#skills .limit, #items .limit {
	width : 60px;
}

#skills .effect, #items .effect {
	width : 360px;
}

#ghost .cause {
	width : 400px;
}

#ghost .power {
	text-align : left;
	width : 420px;
	font-size : 9pt;
}

/* 自動で計算する欄（入力できない） */
input.calc {
	background-color : #eeeeee;
	color : #000000;
}

#status .value {
	font-size : 14pt;
	text-align : center;
}

/* HP・願い・魂・未練の入力欄はセルいっぱいに広げ、見出しは折り返さない */
#status td.input > input[type=text] {
	width : 100%;
	box-sizing : border-box;
	margin : 0;
}

#status th {
	white-space : nowrap;
}

/* PC の幅：列の幅を決め、入力欄をセルいっぱいに広げて余白を作らない
   （狭い画面では edit-responsive.css の並べ方に任せる） */
@media (min-width: 841px) {
	#base {
		table-layout : fixed;
	}
	#base col.col-head { width : 100px; }
	#base col.col-wide { width : 134px; }
	#base col.col-head2 { width : 40px; }
	#base col.col-short { width : 70px; }
	#base col.col-image { width : 206px; }

	#base td.input > input[type=text],
	#base td.input > textarea {
		width : 100%;
		box-sizing : border-box;
		margin : 0;
	}
	/* 設定の欄は、画像の欄に合わせて高くなったセルいっぱいに広げる */
	#base td.memo {
		height : 1px;
	}
	#base td.memo > textarea {
		height : 100%;
		/* 画像の欄（約280px）に合わせて高くし、ほかの行が間延びしないようにする */
		min-height : 150px;
	}
	#base td.image {
		vertical-align : top;
	}

	#status {
		table-layout : fixed;
		width : 260px;
	}
	#status th:first-child {
		width : 40px;
	}
	#status td.input:has(> input[type=checkbox]) {
		width : 24px;
	}
}

/* 能力値の「能力値計算」「能力値表示」のタブ */
#div\.ability ul.abltab {
	width : 204px;
	margin : 0;
}
#div\.ability ul.abltab li.selected {
	background-color : black;
	color : white;
}
.abilityCalc input[type=text] {
	width : 50px;
}

#abilityDerived {
	margin-left : 4px;
}

/* 基本情報の見出しは折り返さない */
#base th {
	white-space : nowrap;
}

/* タブの行の高さを決める（中の項目が float なので、決めないと高さが 0 になる） */
#div\.ability ul.abltab {
	height : 20px;
}
#div\.ability ul.abltab li {
	height : 18px;
	line-height : 18px;
}

/* PC の幅：HP の欄の上端を、能力値の表（タブの下）の上端にそろえる */
@media (min-width: 841px) {
	#div\.status {
		margin-top : 26px;
	}
}

/* 狭い画面：算出値の表を能力値の表の隣に並べる（入力欄を細くして横に収める） */
@media (max-width: 840px) {
	.abilityCalc th {
		white-space : nowrap;
		font-size : 9pt;
		padding : 0 1px;
	}
	.abilityCalc input[type=text] {
		width : 34px !important;
		height : 28px;
		font-size : 13pt;
	}
	#abilityDerived {
		margin-left : 2px;
	}
	/* 画面の幅に合わせて広げる共通の調整（edit-responsive.js）は使わない */
	.abilityCalc {
		--edit-fit : none;
	}
}

/* 狭い画面：能力値表示の入力欄の大きさをそろえる（画面の幅に合わせて広げない） */
@media (max-width: 840px) {
	#ability {
		--edit-fit : none;
	}
	#ability input[type=text] {
		width : 100% !important;
		height : 30px;
		box-sizing : border-box;
		margin : 0;
	}
}

/* 設定の欄は縦のスクロールバーを常に表示する */
#base td.memo > textarea {
	overflow-y : scroll;
}

/* 死因の欄（テキストエリア） */
#ghost textarea.cause {
	height : 48px;
	box-sizing : border-box;
}

/* 狭い画面：設定の欄を4行ぶんの高さにする */
@media (max-width: 840px) {
	#base td.memo > textarea {
		line-height : 1.4;
		height : calc(5.6em + 8px);
	}
}

/* 狭い画面：基本情報を「見出し｜欄｜見出し｜欄」の4列にし、年齢と性別を横に並べる
 （年齢の見出しはほかの見出しと同じ幅の列に置く。ほかの欄は2列目から右端まで使う） */
@media (max-width: 840px) {
	#base > tbody {
		grid-template-columns : max-content minmax(0, 1fr) max-content minmax(0, 1fr);
	}
	#base > tbody > tr > td {
		grid-column : 2 / -1;
	}
	#base > tbody > tr > td[rowspan] {
		grid-column : 1 / -1;
	}
	#base > tbody > tr.age-row > td {
		grid-column : auto;
	}
	#base > tbody > tr.age-row > th + td + th {
		grid-column : 3;
	}

	/* 能力値計算：2つの表を同じ幅で横に並べ、画面の幅いっぱいに広げる（列はすべて同じ幅） */
	#div\.abilityCalc {
		display : flex;
		gap : 2px;
	}
	#div\.abilityCalc > table {
		display : table !important;
		float : none !important;
		flex : 1 1 0;
		width : auto !important;
		table-layout : fixed;
		margin : 0 !important;
	}
	.abilityCalc input[type=text] {
		width : 100% !important;
		box-sizing : border-box;
		margin : 0;
	}
	/* 能力値表示：列を同じ幅にして画面の幅いっぱいに広げる */
	#ability {
		display : table !important;
		table-layout : fixed;
		width : 100% !important;
	}
}
