/*
 * charcount-tool.css
 * CharCount Tool Pro – スタイルシート
 * Version: 2.0.1
 */

/* ── ラッパー ── */
.cctool-wrap {
	box-sizing: border-box;
	max-width: 800px;
	margin: 1.5rem auto;
	padding: 1.5rem;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
	font-size: 0.95rem;
	color: #1a202c;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

/* ── スクリーンリーダー専用テキスト ── */
.cctool-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── テキストエリア ── */
.cctool-textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 0.75rem 1rem;
	border: 1.5px solid #cbd5e0;
	border-radius: 8px;
	font-size: 1rem;
	line-height: 1.7;
	color: #2d3748;
	background: #f8fafc;
	resize: vertical;
	transition: border-color .2s, box-shadow .2s;
	outline: none;
}
.cctool-textarea:focus {
	border-color: #4f8ef7;
	box-shadow: 0 0 0 3px rgba(79, 142, 247, .18);
	background: #ffffff;
}

/* ── 文字数上限行 ── */
.cctool-limit-row {
	margin-top: 0.75rem;
}
.cctool-limit-label {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.875rem;
	color: #4a5568;
	cursor: pointer;
}
.cctool-limit-input {
	width: 100px;
	padding: 0.3rem 0.5rem;
	border: 1px solid #cbd5e0;
	border-radius: 6px;
	font-size: 0.875rem;
	text-align: right;
	transition: border-color .2s;
}
.cctool-limit-input:focus {
	outline: none;
	border-color: #4f8ef7;
	box-shadow: 0 0 0 3px rgba(79, 142, 247, .15);
}

/* ── プログレスバー ── */
.cctool-progress-wrap {
	height: 6px;
	background: #e2e8f0;
	border-radius: 999px;
	margin-top: 0.6rem;
	overflow: hidden;
}
.cctool-progress-bar {
	height: 100%;
	width: 0;
	background: #48bb78;
	border-radius: 999px;
	transition: width .25s ease, background .25s ease;
}
.cctool-progress-bar.cctool-progress-warn {
	background: #ecc94b;
}
.cctool-progress-bar.cctool-progress-over {
	background: #fc8181;
}

/* ── メインスタッツグリッド ── */
.cctool-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.75rem;
	margin-top: 1rem;
}
.cctool-stat-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.75rem 0.5rem;
	background: #f0f4ff;
	border-radius: 8px;
	gap: 0.25rem;
}
.cctool-stat-label {
	font-size: 0.75rem;
	color: #718096;
	text-align: center;
}
.cctool-stat-value {
	font-size: 1.5rem;
	font-weight: 700;
	color: #2b6cb0;
	letter-spacing: -.02em;
	line-height: 1.2;
}

/* ── 文字種別内訳 ── */
.cctool-breakdown {
	margin-top: 1rem;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
}
.cctool-breakdown summary {
	padding: 0.6rem 1rem;
	background: #f7fafc;
	font-size: 0.875rem;
	color: #4a5568;
	cursor: pointer;
	user-select: none;
	list-style: none;
}
.cctool-breakdown summary::-webkit-details-marker {
	display: none;
}
.cctool-breakdown summary::before {
	content: "▶ ";
	font-size: 0.7rem;
}
.cctool-breakdown[open] summary::before {
	content: "▼ ";
}
.cctool-breakdown-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	grid-template-rows: auto auto;
	padding: 0.75rem 1rem;
	background: #ffffff;
	gap: 0;
}
.cctool-bd-label {
	font-size: 0.75rem;
	color: #718096;
	text-align: center;
	padding: 0.25rem 0;
	border-bottom: 1px solid #e2e8f0;
}
.cctool-bd-val {
	font-size: 1.1rem;
	font-weight: 600;
	color: #2d3748;
	text-align: center;
	padding: 0.4rem 0;
}

/* ── 警告メッセージ ── */
.cctool-alert {
	margin-top: 0.75rem;
	padding: 0.6rem 0.9rem;
	background: #fff5f5;
	border: 1px solid #fc8181;
	border-radius: 6px;
	color: #c53030;
	font-size: 0.875rem;
	line-height: 1.5;
}

/* ── アクションボタン群 ── */
.cctool-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1rem;
}
.cctool-btn {
	padding: 0.5rem 1.2rem;
	border: none;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, transform .1s, opacity .2s;
	background: #4f8ef7;
	color: #ffffff;
}
.cctool-btn:hover {
	background: #3a78e6;
}
.cctool-btn:active {
	transform: scale(.97);
}
.cctool-btn:disabled {
	opacity: .55;
	cursor: default;
}
.cctool-btn-reset {
	background: #e2e8f0;
	color: #4a5568;
}
.cctool-btn-reset:hover {
	background: #cbd5e0;
}
.cctool-btn-export {
	background: #68d391;
	color: #1a202c;
}
.cctool-btn-export:hover {
	background: #48bb78;
}

/* ── レスポンシブ ── */
@media (max-width: 480px) {
	.cctool-wrap {
		padding: 1rem;
	}
	.cctool-stats {
		grid-template-columns: repeat(2, 1fr);
	}
	.cctool-stat-value {
		font-size: 1.25rem;
	}
	.cctool-breakdown-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}