/**
 * お香ツール 共通スタイル
 * 7ツール共通のスタイル（伽羅色・茶系テーマ）
 */

/* ========================================
   フォーム関連
   ======================================== */
.form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px 24px;
}

.form-grid--single {
	grid-template-columns: 1fr;
}

.form-grid--three {
	grid-template-columns: repeat(3, 1fr);
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
}

.input-with-unit {
	display: flex;
	align-items: center;
	gap: 8px;
}

.form-input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	font-size: 16px;
	color: var(--color-text);
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	transition: border-color 0.2s;
	font-family: inherit;
}

.form-input:focus {
	outline: none;
	border-color: #8D6E63;
}

.form-select {
	cursor: pointer;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px;
	padding-right: 36px;
	appearance: none;
	-webkit-appearance: none;
}

.input-unit {
	font-size: 14px;
	color: var(--color-text-secondary);
	flex-shrink: 0;
	min-width: 24px;
}

.form-hint {
	font-size: 12px;
	color: var(--color-text-muted);
	line-height: 1.5;
}

/* ========================================
   結果セクション（伽羅色グラデーション）
   ======================================== */
.result-section {
	padding: 28px 20px;
	background: linear-gradient(135deg, #8D6E63 0%, #5D4037 100%);
	text-align: center;
	color: var(--color-white);
}

.result-main {
	margin-bottom: 16px;
}

.result-header {
	margin-bottom: 8px;
}

.result-label {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.9);
}

.result-value-wrap {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}

.result-value {
	font-family: var(--font-display);
	font-size: 56px;
	font-weight: 700;
	color: var(--color-white);
	line-height: 1;
}

.result-unit {
	font-size: 18px;
	color: rgba(255, 255, 255, 0.9);
}

.result-sub {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.result-sub-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.result-sub-label {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.85);
}

.result-sub-value-wrap {
	display: flex;
	align-items: baseline;
	gap: 4px;
}

.result-sub-value {
	font-family: var(--font-display);
	font-size: 24px;
	font-weight: 700;
	color: var(--color-white);
	line-height: 1;
}

.result-sub-unit {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   判定バッジ
   ======================================== */
.judgment-badge {
	display: inline-block;
	padding: 6px 16px;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 700;
	border-radius: 20px;
}

.judgment-badge--high {
	background: #fff;
	color: #5D4037;
}

.judgment-badge--mid {
	background: rgba(255, 255, 255, 0.85);
	color: #f57c00;
}

.judgment-badge--low {
	background: rgba(255, 255, 255, 0.7);
	color: #2e7d32;
}

.judgment-badge--unknown {
	background: rgba(255, 255, 255, 0.6);
	color: var(--color-text-muted);
}

/* ========================================
   セクションタイトル
   ======================================== */
.section-title {
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 700;
	color: var(--color-text);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.section-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
}

.section-icon--info {
	background: #EFEBE9;
	color: #5D4037;
}

.section-icon--warning {
	background: #fff3e0;
	color: #f57c00;
}

.section-icon--success {
	background: #e8f5e9;
	color: #2e7d32;
}

/* ========================================
   免責事項
   ======================================== */
.disclaimer-box {
	margin-top: 14px;
	padding: 12px 14px;
	background: #EFEBE9;
	border: 1px solid #D7CCC8;
	border-left: 4px solid #8D6E63;
	border-radius: var(--radius);
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.disclaimer-icon {
	flex-shrink: 0;
	font-size: 16px;
	color: #8D6E63;
}

.disclaimer-text {
	flex: 1;
	font-size: 12px;
	color: #4E342E;
	line-height: 1.6;
}

.disclaimer-text strong {
	color: #3E2723;
}

/* ========================================
   詳細セクション
   ======================================== */
.detail-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.detail-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid var(--color-border);
	font-size: 14px;
}

.detail-item:last-child {
	border-bottom: none;
}

.detail-label {
	color: var(--color-text-secondary);
	flex-shrink: 0;
}

.detail-value {
	font-weight: 600;
	color: var(--color-text);
	text-align: right;
}

.detail-note {
	font-size: 13px;
	color: var(--color-text-secondary);
	line-height: 1.6;
	padding: 10px 12px;
	background: #EFEBE9;
	border-radius: var(--radius);
}

/* ========================================
   関連ツール
   ======================================== */
.related-tools-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.related-tools-item {
	margin: 0;
}

.related-tools-link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	text-decoration: none;
	transition: all 0.2s ease;
}

.related-tools-link:hover {
	background: var(--color-white);
	border-color: #8D6E63;
}

.related-tools-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 700;
	color: var(--color-white);
	background: linear-gradient(135deg, #8D6E63 0%, #5D4037 100%);
	border-radius: var(--radius);
}

.related-tools-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.related-tools-name {
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text);
}

.related-tools-desc {
	font-size: 12px;
	color: var(--color-text-secondary);
	line-height: 1.5;
}

/* ========================================
   タブ
   ======================================== */
.tab-nav {
	display: flex;
	border-bottom: 2px solid var(--color-border);
	margin-bottom: 16px;
	gap: 0;
	flex-wrap: wrap;
}

.tab-btn {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text-secondary);
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.tab-btn:hover {
	color: #8D6E63;
}

.tab-btn.active {
	color: #5D4037;
	border-bottom-color: #8D6E63;
}

.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
}

/* ========================================
   テーブル
   ======================================== */
.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.data-table th {
	padding: 10px 12px;
	background: #EFEBE9;
	color: #4E342E;
	font-weight: 600;
	text-align: left;
	border-bottom: 2px solid #BCAAA4;
	font-size: 13px;
}

.data-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--color-border);
	color: var(--color-text);
}

.data-table tr:hover td {
	background: #FAF7F5;
}

.data-table tr.highlighted td {
	background: #EFEBE9;
	font-weight: 600;
}

.data-table .text-center {
	text-align: center;
}

.data-table .text-right {
	text-align: right;
}

/* ========================================
   モード切替ラジオ
   ======================================== */
.mode-toggle {
	display: flex;
	gap: 0;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
}

.mode-toggle label {
	flex: 1;
	padding: 10px 16px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text-secondary);
	cursor: pointer;
	transition: all 0.2s;
	border-right: 1px solid var(--color-border);
}

.mode-toggle label:last-child {
	border-right: none;
}

.mode-toggle input[type="radio"] {
	display: none;
}

.mode-toggle input[type="radio"]:checked + label,
.mode-toggle label.active {
	background: #8D6E63;
	color: #fff;
}

/* ========================================
   ボタン
   ======================================== */
.btn-primary {
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-white);
	background: linear-gradient(135deg, #8D6E63 0%, #5D4037 100%);
	border: none;
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.btn-primary:hover {
	background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
}

.btn-secondary {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 500;
	color: #5D4037;
	background: var(--color-white);
	border: 1px solid #8D6E63;
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.btn-secondary:hover {
	background: #EFEBE9;
}

.btn-add-row {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #5D4037;
	background: #EFEBE9;
	border: 1px dashed #BCAAA4;
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.btn-add-row:hover {
	background: #D7CCC8;
	border-color: #8D6E63;
}

.btn-add-row:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-remove-row {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	font-size: 18px;
	font-weight: 700;
	color: #c62828;
	background: #FFEBEE;
	border: 1px solid #EF9A9A;
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1;
	padding: 0;
}

.btn-remove-row:hover {
	background: #FFCDD2;
	border-color: #C62828;
}

/* ========================================
   アクションボタン
   ======================================== */
.action-section {
	display: flex;
	justify-content: center;
	gap: 12px;
	padding: 12px 20px;
	flex-wrap: wrap;
}

/* ========================================
   入力セクション
   ======================================== */
.input-section {
	border-bottom: 1px solid var(--color-border);
}

/* ========================================
   レシピサマリー
   ======================================== */
.recipe-summary {
	background: #FAF7F5;
	border: 1px solid #D7CCC8;
	border-radius: var(--radius);
	padding: 14px 16px;
	margin-top: 12px;
}

.recipe-summary-title {
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	color: #4E342E;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.recipe-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 4px 0;
	font-size: 13px;
	color: var(--color-text);
}

.recipe-summary-row .label {
	color: var(--color-text-secondary);
}

.recipe-summary-row .value {
	font-weight: 600;
	color: #5D4037;
}

/* ========================================
   情報ボックス（補足説明）
   ======================================== */
.info-box {
	background: #EFEBE9;
	border-left: 3px solid #8D6E63;
	padding: 10px 14px;
	border-radius: 4px;
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.6;
	color: #4E342E;
}

.info-box strong {
	color: #3E2723;
}

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

	.result-value {
		font-size: 44px;
	}

	.result-sub-value {
		font-size: 20px;
	}

	.tab-btn {
		padding: 8px 12px;
		font-size: 13px;
	}

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

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