/**
 * 作品サイズ調整計算ツール - 専用スタイル
 * （共通スタイルは knitting-common.css を参照）
 */

/* ========================================
   プリセットボタン
   ======================================== */
.preset-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.preset-label-text {
	font-size: 13px;
	color: var(--color-text-secondary);
	flex-shrink: 0;
}

.preset-btn {
	padding: 8px 18px;
	font-size: 13px;
	font-family: inherit;
	font-weight: 600;
	color: #7B1FA2;
	background: var(--color-white);
	border: 1px solid #7B1FA2;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.preset-btn:hover,
.preset-btn.active {
	color: var(--color-white);
	background: #7B1FA2;
}

/* ========================================
   パーツリスト
   ======================================== */
.parts-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.part-item {
	padding: 14px 16px;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	transition: border-color 0.2s;
}

.part-item:hover {
	border-color: #ce93d8;
}

.part-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.part-number {
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 700;
	color: #7B1FA2;
}

.part-remove-btn {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: var(--color-text-muted);
	background: none;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
	line-height: 1;
}

.part-remove-btn:hover {
	color: #d32f2f;
	border-color: #d32f2f;
	background: #ffebee;
}

.part-fields {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.part-name-group {
	max-width: 240px;
}

.part-size-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

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

.part-size-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--color-text-secondary);
}

.part-size-inputs {
	display: flex;
	align-items: center;
	gap: 6px;
}

.part-size-inputs .input-with-unit {
	flex: 1;
	min-width: 0;
}

.part-size-inputs .form-input {
	width: 100%;
	min-width: 0;
}

.part-size-x {
	font-size: 14px;
	color: var(--color-text-muted);
	flex-shrink: 0;
}

/* ========================================
   パーツ追加ボタン・カウント
   ======================================== */
.parts-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 14px;
}

.btn-add-part {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	color: #7B1FA2;
	background: #f3e5f5;
	border: 1px dashed #ce93d8;
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s;
}

.btn-add-part:hover {
	background: #e1bee7;
	border-color: #7B1FA2;
}

.btn-add-part.disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.btn-add-icon {
	font-size: 16px;
	font-weight: 700;
}

.parts-count-hint {
	font-size: 12px;
	color: var(--color-text-muted);
}

/* ========================================
   詳細テーブル - 比較表
   ======================================== */
.detail-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 14px;
}

.comparison-table th.th-group-original {
	background: #e8eaf6;
	color: #283593;
	border-bottom-color: #7986cb;
}

.comparison-table th.th-group-new {
	background: #e8f5e9;
	color: #2e7d32;
	border-bottom-color: #81c784;
}

.comparison-table th.th-group-diff {
	background: #fff3e0;
	color: #e65100;
	border-bottom-color: #ffb74d;
}

.comparison-table th.th-sub {
	font-size: 11px;
	font-weight: 500;
	padding: 6px 8px;
}

.comparison-table .part-name-cell {
	font-weight: 600;
	color: #4A0072;
	white-space: nowrap;
}

.comparison-table .diff-plus {
	color: #2e7d32;
	font-weight: 600;
}

.comparison-table .diff-minus {
	color: #d32f2f;
	font-weight: 600;
}

/* ========================================
   詳細セクション
   ======================================== */
.detail-section {
	padding: 20px;
}

/* ========================================
   アクションボタン
   ======================================== */
.action-section {
	padding: 0 20px 20px;
	text-align: center;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 600px) {
	.part-size-row {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.part-item {
		padding: 12px;
	}

	.part-name-group {
		max-width: 100%;
	}

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

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

	.comparison-table th.th-sub {
		font-size: 10px;
		padding: 4px;
	}

	.preset-buttons {
		gap: 8px;
	}

	.preset-btn {
		padding: 6px 14px;
		font-size: 12px;
	}

	.parts-actions {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start;
	}
}
