/**
 * SAJE Pro — 学校記事フロント（テーブル用）
 * 都平均一覧・過去倍率テーブル等で共通利用可
 */

/* 各 article section をブロック単位で分離 */
.saje-article-section {
	display: block;
	margin-bottom: 1em;
}
.saje-article-section:last-child {
	margin-bottom: 0;
}

/* テーマの post_content > * 直下セレクタを再現（wrapper で遮られたブロック間余白） */
.saje-article-section > * + * {
	margin-top: 1.5em;
}
.saje-metro-avg-history {
	width: 100%;
	border-collapse: collapse;
}
.saje-metro-avg-history th,
.saje-metro-avg-history td {
	text-align: center;
	vertical-align: middle;
	padding: 10px 12px;
	border: 1px solid #ccc;
}

.saje-ratio-history {
	width: 100%;
	border-collapse: collapse;
}
.saje-ratio-history th,
.saje-ratio-history td {
	text-align: center;
	vertical-align: middle;
	padding: 8px 10px;
	border: 1px solid #ccc;
}

/* ===== 合否判定フォーム ===== */
.saje-judge-form-wrap {
	width: 100%;
	margin: 1.5em 0;
	padding: 1.25em 1.5em;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.saje-form-title {
	font-size: 1.1em;
	font-weight: 600;
	margin: 0 0 0.3em;
}

.saje-form-desc {
	margin: 0 0 1em;
	font-size: 0.9em;
	color: #555;
}

.saje-judge-form {
	display: block;
}

.saje-judge-section {
	margin-bottom: 1.5em;
}

.saje-section-label {
	font-size: 0.95em;
	font-weight: 600;
	margin-bottom: 0.6em;
	color: #333;
}

/* モード切替タブ */
.saje-naishin-mode-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 1em;
	border: 1px solid #ccc;
}

.saje-mode-tab {
	flex: 1;
	display: block;
	text-align: center;
	padding: 0.5em 0.75em;
	cursor: pointer;
	background: #f0f0f0;
	color: #666;
	border-right: 1px solid #ccc;
}

.saje-mode-tab:last-child {
	border-right: none;
}

.saje-mode-tab input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.saje-mode-tab.saje-tab-active {
	background: #fff;
	color: #222;
	font-weight: 600;
}

/* 入力パネル */
.saje-naishin-panel {
	padding: 1em;
	border: 1px solid #ddd;
	margin-bottom: 1em;
}

.saje-panel-active {
	background: #fff;
}

.saje-panel-inactive {
	background: #e8e8e8;
	color: #888;
	pointer-events: none;
}

.saje-panel-inactive,
.saje-panel-inactive * {
	pointer-events: none !important;
	cursor: not-allowed !important;
}

.saje-panel-inactive input,
.saje-panel-inactive select {
	background: #e0e0e0 !important;
	color: #999 !important;
}

/* 9科内申：PC 9列1行 / スマホ 2段 */
.saje-naishin-9-grid {
	display: grid;
	grid-template-columns: repeat(9, minmax(0, 1fr));
	gap: 0.4em 0.6em;
	margin-bottom: 0.75em;
}

@media (max-width: 640px) {
	.saje-naishin-9-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

.saje-naishin-cell {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

.saje-naishin-label {
	display: block;
	width: 100%;
	font-size: 0.85em;
	text-align: center;
}

.saje-naishin-select {
	width: 100%;
	min-width: 0;
	max-width: 3.5em;
	padding: 0.3em 0.25em;
	font-size: 0.95em;
	margin: 0 auto;
	text-align: center;
}

/* 換算内申・調査書点 2カラム */
.saje-naishin-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em;
}

@media (max-width: 480px) {
	.saje-naishin-2col {
		grid-template-columns: 1fr;
	}
}

.saje-naishin-2col .saje-naishin-panel {
	margin-bottom: 0;
}

/* 計算結果ボックス */
.saje-result-box {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 1em;
	margin-top: 0.6em;
	padding: 0.4em 0.6em;
	border: 1px solid #e0e0e0;
	font-size: 0.9em;
}

.saje-input-row {
	display: block;
	margin-bottom: 0.5em;
}

.saje-input-label {
	display: block;
	margin-bottom: 0.2em;
	font-size: 0.9em;
}

.saje-input-number {
	width: 100%;
	max-width: 8em;
	padding: 0.35em;
	text-align: center;
}

/* 得点入力：国数英社理 5列 */
.saje-exam-input-card {
	padding: 1em;
	border: 1px solid #ddd;
}

.saje-exam-5-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.4em 0.6em;
	margin-bottom: 0.75em;
}

@media (max-width: 480px) {
	.saje-exam-5-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.saje-exam-cell {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

.saje-exam-label {
	display: block;
	width: 100%;
	font-size: 0.85em;
	text-align: center;
}

.saje-exam-input {
	width: 100%;
	min-width: 0;
	max-width: 4em;
	padding: 0.3em;
	margin: 0 auto;
	text-align: center;
}

.saje-exam-display {
	margin-top: 0.6em;
}

/* アクション・結果 */
.saje-judge-actions {
	margin: 1.25em 0 1em;
}

.saje-judge-submit {
	padding: 0.5em 1.5em;
	background: #0073aa;
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 1em;
}

.saje-judge-submit:hover:not(:disabled) {
	background: #005a87;
}

.saje-judge-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.saje-judge-error {
	display: none;
	margin: 1em 0;
	padding: 0.75em;
	background: #fff5f5;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.saje-judge-result-wrap {
	margin-top: 1.5em;
	padding: 1.1em 1.2em;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.saje-judge-result .saje-result-standard {
	margin: 0 0 0.55em;
	font-size: 1.1em;
}

.saje-judge-result .saje-result-lead {
	margin: 0 0 0.5em;
	font-size: 0.98em;
	color: #333;
}

.saje-judge-result .saje-result-total {
	margin: 0 0 0.4em;
	font-size: 1.1em;
}

.saje-judge-result .saje-result-sub {
	margin: 0 0 0.7em;
	font-size: 0.95em;
	color: #555;
	line-height: 1.5;
}

.saje-judge-result .saje-result-meta {
	margin: 0 0 0.35em;
	font-size: 0.95em;
	color: #444;
	font-weight: 700;
}

.saje-judge-result .saje-result-comment {
	margin: 0.5em 0 0;
	font-size: 0.95em;
	line-height: 1.6;
	font-weight: 700;
}

/* 低倍率注意文：テーマ継承を上書きして確実に適用 */
.saje-judge-result-wrap .saje-judge-result .saje-result-low-ratio-notice,
.saje-judge-result .saje-result-low-ratio-notice {
	display: block;
	margin: 0.6em 0 0 !important;
	padding: 0.5em 0.75em 0.5em 0.9em !important;
	font-size: 0.88em !important;
	line-height: 1.55 !important;
	color: #555 !important;
	background-color: #f8f8f8 !important;
	border-left: 3px solid #ccc !important;
}

/* ===== 複数校比較判定 ===== */
.saje-multi-judge-form-wrap {
	width: 100%;
	margin: 1.5em 0;
	padding: 1.25em 1.5em;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.saje-multi-judge-section {
	margin-bottom: 1.5em;
}

.saje-main-school-select {
	min-width: 200px;
	max-width: 100%;
	padding: 0.4em 0.5em;
}

.saje-compare-schools-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1.5em;
	margin-top: 0.5em;
}

.saje-compare-school-item {
	display: flex;
	align-items: center;
	gap: 0.35em;
	cursor: pointer;
}

.saje-school-add-section {
	margin-top: 1.25em;
	padding-top: 1.25em;
	border-top: 1px solid #eee;
}

.saje-school-add-desc {
	margin: 0 0 0.5em;
	font-size: 0.9em;
	color: #666;
}

.saje-school-search-row {
	display: flex;
	gap: 0.5em;
	margin-bottom: 0.75em;
}

.saje-school-search-input {
	flex: 1;
	min-width: 0;
	max-width: 280px;
	padding: 0.4em 0.5em;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.saje-school-search-btn {
	padding: 0.4em 1em;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95em;
}

.saje-school-search-btn:hover {
	background: #005a87;
}

.saje-school-search-result {
	margin-top: 0.5em;
	font-size: 0.9em;
	max-height: 200px;
	overflow-y: auto;
}

.saje-school-search-result-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	padding: 0.35em 0;
	border-bottom: 1px solid #f0f0f0;
}

.saje-school-search-result-item:last-child {
	border-bottom: none;
}

.saje-school-add-btn {
	padding: 0.2em 0.6em;
	font-size: 0.85em;
	background: #46b450;
	color: #fff;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	flex-shrink: 0;
}

.saje-school-add-btn:hover {
	background: #3a9e42;
}

.saje-school-add-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.saje-compare-school-item-wrap {
	display: flex;
	align-items: center;
	gap: 0.35em;
}

.saje-school-remove-btn {
	padding: 0.15em 0.4em;
	font-size: 0.8em;
	background: transparent;
	color: #a00;
	border: 1px solid #a00;
	border-radius: 3px;
	cursor: pointer;
	margin-left: 0.25em;
}

.saje-school-remove-btn:hover {
	background: #a00;
	color: #fff;
}

.saje-multi-judge-result {
	margin-top: 1em;
}

.saje-multi-judge-total-score {
	margin: 0 0 0.75em;
	font-size: 1.1em;
	font-weight: 700;
}

.saje-multi-judge-table-wrap {
	overflow-x: auto;
}

.saje-multi-judge-table {
	width: 100%;
	border-collapse: collapse;
}

.saje-multi-judge-table th,
.saje-multi-judge-table td {
	padding: 8px 12px;
	border: 1px solid #ccc;
	text-align: center;
	vertical-align: middle;
}

.saje-multi-judge-table th {
	background: #f5f5f5;
	font-weight: 600;
	white-space: normal;
	line-height: 1.35;
	text-align: center;
}

#saje-multi-judge-result .saje-multi-judge-table td.saje-cell-school,
#saje-multi-judge-result .saje-multi-judge-table td.saje-cell-judge-index {
	font-weight: 800 !important;
}

#saje-multi-judge-result .saje-multi-judge-reference-years {
	margin: 0.75em 0 0;
	padding: 0.5em 0;
	font-size: 1rem;
	line-height: 1.5;
	color: #333;
}

#saje-multi-judge-result .saje-multi-judge-internal-index {
	margin: 0.5em 0 0;
	font-size: 0.7rem;
	line-height: 1.4;
	color: #666;
}

#saje-multi-judge-result .saje-multi-judge-note {
	margin: 0.5em 0 0;
	font-size: 1rem;
	line-height: 1.5;
	color: #666;
}

.saje-multi-judge-empty {
	margin: 1em 0;
	color: #666;
}
