/**
 * TOEIC診断UI スタイル（モバイルファースト / PROJECT_BRIEF §8）。
 * SNS流入のスマホ縦画面を前提に、まずモバイルを定義し min-width で拡張する。
 * テーマ干渉を避けるため .toeic-shindan 配下にスコープし、独自トークンを使う。
 */

.toeic-shindan {
	--ts-bg: #ffffff;
	--ts-fg: #1f2430;
	--ts-muted: #6b7280;
	--ts-primary: #2563eb;
	--ts-primary-dark: #1d4ed8;
	--ts-cta: #f97316;
	--ts-cta-dark: #ea580c;
	--ts-line: #06c755;
	--ts-weak: #ef4444;
	--ts-track: #e5e7eb;
	--ts-card: #ffffff;
	--ts-border: #e5e7eb;
	--ts-radius: 14px;
	--ts-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);

	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	padding: 12px;
	color: var(--ts-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
		"Noto Sans JP", "Segoe UI", Meiryo, sans-serif;
	line-height: 1.6;
	-webkit-text-size-adjust: 100%;
}

.toeic-shindan *,
.toeic-shindan *::before,
.toeic-shindan *::after {
	box-sizing: border-box;
}

/* PR・商標などの法務表記 */
.toeic-shindan .ts-pr-disclosure,
.toeic-shindan .ts-trademark {
	font-size: 11px;
	color: var(--ts-muted);
	margin: 6px 0;
}
.toeic-shindan .ts-trademark {
	margin-top: 16px;
}

/* カード共通 */
.toeic-shindan .ts-card {
	background: var(--ts-card);
	border: 1px solid var(--ts-border);
	border-radius: var(--ts-radius);
	box-shadow: var(--ts-shadow);
	padding: 20px 16px;
	margin: 8px 0;
}

.toeic-shindan .ts-title {
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 8px;
	line-height: 1.35;
}
.toeic-shindan .ts-subtitle {
	font-size: 16px;
	font-weight: 700;
	margin: 22px 0 10px;
}
.toeic-shindan .ts-lead {
	color: var(--ts-muted);
	margin: 0 0 18px;
}
.toeic-shindan .ts-note {
	font-size: 11px;
	color: var(--ts-muted);
	margin-top: 14px;
}

/* ボタン共通（タップしやすい高さ） */
.toeic-shindan .ts-btn {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 14px 18px;
	border: none;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.05s ease, background-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.toeic-shindan .ts-btn:active {
	transform: scale(0.99);
}
.toeic-shindan .ts-btn-primary {
	background: var(--ts-primary);
	color: #fff;
}
.toeic-shindan .ts-btn-primary:hover {
	background: var(--ts-primary-dark);
}
.toeic-shindan .ts-btn-cta {
	background: var(--ts-cta);
	color: #fff;
	margin-top: 12px;
	box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}
.toeic-shindan .ts-btn-cta:hover {
	background: var(--ts-cta-dark);
}
.toeic-shindan .ts-btn-line {
	background: var(--ts-line);
	color: #fff;
	margin-top: 8px;
}
.toeic-shindan .ts-btn-ghost {
	background: transparent;
	color: var(--ts-muted);
	border: 1px solid var(--ts-border);
	margin-top: 18px;
	font-weight: 600;
}

/* 進捗バー */
.toeic-shindan .ts-progress {
	position: relative;
	background: var(--ts-track);
	border-radius: 999px;
	height: 8px;
	margin-bottom: 18px;
}
.toeic-shindan .ts-progress-bar {
	background: var(--ts-primary);
	height: 100%;
	border-radius: 999px;
	transition: width 0.25s ease;
}
.toeic-shindan .ts-progress-label {
	position: absolute;
	right: 0;
	top: 12px;
	font-size: 11px;
	color: var(--ts-muted);
}

/* 設問 */
.toeic-shindan .ts-passage {
	background: #f8fafc;
	border: 1px solid var(--ts-border);
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	white-space: pre-line;
	margin-bottom: 14px;
}
.toeic-shindan .ts-stem {
	font-size: 17px;
	font-weight: 600;
	margin: 4px 0 16px;
}
.toeic-shindan .ts-choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.toeic-shindan .ts-choice {
	width: 100%;
	min-height: 50px;
	padding: 13px 16px;
	background: #fff;
	color: var(--ts-fg);
	border: 1.5px solid var(--ts-border);
	border-radius: 12px;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.toeic-shindan .ts-choice:hover {
	border-color: var(--ts-primary);
	background: #f5f8ff;
}
.toeic-shindan .ts-choice:active {
	background: #eef3ff;
}

/* 結果: スコア */
.toeic-shindan .ts-score-block {
	text-align: center;
	padding: 8px 0 4px;
}
.toeic-shindan .ts-score-caption {
	display: block;
	font-size: 13px;
	color: var(--ts-muted);
}
.toeic-shindan .ts-score-value {
	display: block;
	font-size: 56px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--ts-primary);
	letter-spacing: 1px;
}
.toeic-shindan .ts-score-range {
	font-size: 11px;
	color: var(--ts-muted);
}

/* 結果: パート別バー */
.toeic-shindan .ts-bars {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.toeic-shindan .ts-bar-head {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	margin-bottom: 4px;
}
.toeic-shindan .ts-bar-label {
	font-weight: 600;
}
.toeic-shindan .ts-bar-pct {
	color: var(--ts-muted);
}
.toeic-shindan .ts-bar-track {
	background: var(--ts-track);
	border-radius: 999px;
	height: 10px;
	overflow: hidden;
}
.toeic-shindan .ts-bar-fill {
	height: 100%;
	background: var(--ts-primary);
	border-radius: 999px;
	transition: width 0.4s ease;
}
.toeic-shindan .ts-bar-row.is-weak .ts-bar-fill {
	background: var(--ts-weak);
}
.toeic-shindan .ts-bar-row.is-weak .ts-bar-pct {
	color: var(--ts-weak);
	font-weight: 700;
}
.toeic-shindan .ts-weak-note {
	background: #fff7ed;
	border-left: 4px solid var(--ts-cta);
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 14px;
	margin-top: 16px;
}

/* 結果: 案件カード */
.toeic-shindan .ts-offers {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.toeic-shindan .ts-offer {
	position: relative;
	border: 1px solid var(--ts-border);
	border-radius: 12px;
	padding: 16px;
	background: #fff;
}
.toeic-shindan .ts-offer.is-top {
	border-color: var(--ts-cta);
	box-shadow: 0 4px 16px rgba(249, 115, 22, 0.18);
}
.toeic-shindan .ts-offer-rank {
	display: inline-block;
	background: var(--ts-cta);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
	margin-bottom: 8px;
}
.toeic-shindan .ts-offer-badge {
	display: inline-block;
	background: #eef2ff;
	color: var(--ts-primary-dark);
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 6px;
	margin-left: 6px;
}
.toeic-shindan .ts-offer-name {
	font-size: 16px;
	font-weight: 700;
	margin: 8px 0 6px;
}
.toeic-shindan .ts-offer-catch {
	font-size: 14px;
	color: var(--ts-fg);
	margin: 0 0 8px;
}
.toeic-shindan .ts-offer-reason {
	font-size: 12px;
	color: var(--ts-primary-dark);
	background: #eff6ff;
	padding: 6px 10px;
	border-radius: 6px;
	margin: 0 0 4px;
}
.toeic-shindan .ts-offer-pr {
	position: absolute;
	top: 10px;
	right: 12px;
	font-size: 10px;
	color: var(--ts-muted);
}

/* 結果: リスト登録 */
.toeic-shindan .ts-list-signup {
	margin-top: 26px;
	padding: 18px 16px;
	background: #f0fdf4;
	border: 1px dashed var(--ts-line);
	border-radius: 12px;
}
.toeic-shindan .ts-list-desc {
	font-size: 13px;
	color: var(--ts-muted);
	margin: 0 0 12px;
}
.toeic-shindan .ts-list-email {
	margin-top: 16px;
}

/* ローディング */
.toeic-shindan .ts-loading {
	text-align: center;
	color: var(--ts-muted);
	padding: 30px 0;
}

/* タブレット以上の微調整 */
@media (min-width: 600px) {
	.toeic-shindan .ts-card {
		padding: 28px 24px;
	}
	.toeic-shindan .ts-title {
		font-size: 26px;
	}
	.toeic-shindan .ts-score-value {
		font-size: 64px;
	}
}

/* ダークモード対応（OS設定に追従） */
@media (prefers-color-scheme: dark) {
	.toeic-shindan {
		--ts-bg: #0f1420;
		--ts-fg: #e5e7eb;
		--ts-muted: #9ca3af;
		--ts-card: #161c2b;
		--ts-border: #2a3242;
		--ts-track: #2a3242;
		--ts-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
	}
	.toeic-shindan .ts-passage {
		background: #1b2233;
	}
	.toeic-shindan .ts-choice {
		background: #1b2233;
	}
	.toeic-shindan .ts-choice:hover {
		background: #20283b;
	}
	.toeic-shindan .ts-weak-note {
		background: #2a2010;
	}
	.toeic-shindan .ts-offer,
	.toeic-shindan .ts-offer.is-top {
		background: #161c2b;
	}
	.toeic-shindan .ts-offer-reason {
		background: #1b2740;
	}
	.toeic-shindan .ts-list-signup {
		background: #11241a;
	}
}
