/**
 * 匂い袋配合計算ツール - 専用スタイル
 * （共通スタイルは incense-common.css を参照）
 */

/* ========================================
   テンプレートカード
   ======================================== */
.template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin-bottom: 8px;
}

.template-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 12px 14px;
	background: #FAF7F5;
	border: 2px solid #D7CCC8;
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: left;
	font-family: inherit;
}

.template-card:hover {
	background: #EFEBE9;
	border-color: #8D6E63;
}

.template-card.active {
	background: linear-gradient(135deg, #EFEBE9 0%, #D7CCC8 100%);
	border-color: #5D4037;
	box-shadow: 0 0 0 1px #8D6E63 inset;
}

.template-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: linear-gradient(135deg, #8D6E63 0%, #5D4037 100%);
	color: #fff;
	border-radius: 8px;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 700;
}

.template-card.active .template-icon {
	background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
}

.template-name {
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	color: #4E342E;
}

.template-desc {
	font-size: 11px;
	color: var(--color-text-secondary);
	line-height: 1.5;
}

/* ========================================
   比率入力行
   ======================================== */
.ratio-row {
	padding: 8px 0;
	border-bottom: 1px solid var(--color-border);
}

.ratio-row:last-child {
	border-bottom: none;
}

.ratio-row-fields {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ing-field {
	min-width: 0;
}

.ing-field--select {
	flex: 2;
	min-width: 200px;
}

.ing-field--name {
	flex: 1;
	min-width: 140px;
}

.ing-field--ratio {
	flex: 0 0 110px;
}

.ing-field--price {
	flex: 0 0 130px;
}

.ing-field--action {
	flex-shrink: 0;
	width: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ========================================
   合計サマリー
   ======================================== */
.ratio-summary {
	margin-top: 14px;
	padding: 10px 14px;
	background: #EFEBE9;
	border-radius: var(--radius);
	font-size: 14px;
	font-weight: 600;
	color: #4E342E;
	text-align: center;
}

.ratio-summary.zero {
	background: #F5F5F5;
	color: var(--color-text-muted);
}

.ratio-summary.warn {
	background: #FFF8E1;
	color: #F57C00;
}

.ratio-summary.over {
	background: #FFEBEE;
	color: #C62828;
}

#ratioTotal {
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 700;
}

/* ========================================
   詳細テーブル
   ======================================== */
.detail-section {
	border-bottom: 1px solid var(--color-border);
}

.row-total td {
	background: #EFEBE9 !important;
	border-top: 2px solid #8D6E63;
	font-size: 14px;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 600px) {
	.template-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.template-card {
		padding: 10px;
	}

	.ratio-row-fields {
		gap: 8px;
	}

	.ing-field--select,
	.ing-field--name {
		flex: 1 1 100%;
		min-width: 0;
	}

	.ing-field--ratio {
		flex: 1 1 calc(60% - 24px);
	}

	.ing-field--price {
		flex: 1 1 calc(40% - 24px);
	}

	.ing-field--action {
		width: 28px;
	}

	.data-table {
		font-size: 12px;
	}

	.data-table th,
	.data-table td {
		padding: 6px 4px;
	}
}
