/**
 * iframe 埋め込み用フォームのスタイル。
 *
 * テーマの CSS を読み込まないため、必要なリセットもここに含める。
 * 高さは固定運用のため、収まらない場合は iframe 内でスクロールさせる。
 */

.aliceh-sc-body {
	margin: 0;
	padding: 0;
	background: #fff;
	color: #1f2328;
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Meiryo", sans-serif;
	font-size: 14px;
	line-height: 1.6;
	-webkit-text-size-adjust: 100%;
}

.aliceh-sc *,
.aliceh-sc *::before,
.aliceh-sc *::after {
	box-sizing: border-box;
}

.aliceh-sc {
	max-width: 860px;
	margin: 0 auto;
	padding: 20px 16px 40px;
}

.aliceh-sc__section {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e5e7eb;
}

.aliceh-sc__heading {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 600;
}

.aliceh-sc__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.aliceh-sc__rows {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.aliceh-sc__row {
	display: grid;
	grid-template-columns: 24px repeat(auto-fit, minmax(120px, 1fr)) 32px;
	align-items: end;
	gap: 8px;
	padding: 8px;
	background: #f9fafb;
	border-radius: 6px;
}

.aliceh-sc__row-index {
	padding-bottom: 8px;
	color: #6b7280;
	font-size: 12px;
	text-align: center;
}

.aliceh-sc__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.aliceh-sc__label {
	color: #4b5563;
	font-size: 12px;
}

.aliceh-sc__required {
	display: inline-block;
	margin-left: 4px;
	padding: 1px 5px;
	border-radius: 3px;
	background: #fee2e2;
	color: #b91c1c;
	font-size: 10px;
	line-height: 1.5;
	vertical-align: 1px;
}

.aliceh-sc__control {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
}

.aliceh-sc__control:focus {
	outline: 2px solid #2563eb;
	outline-offset: -1px;
	border-color: #2563eb;
}

.aliceh-sc__add {
	margin-top: 10px;
	padding: 6px 12px;
	border: 1px dashed #9ca3af;
	border-radius: 4px;
	background: none;
	color: #374151;
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
}

.aliceh-sc__add:hover {
	border-color: #2563eb;
	color: #2563eb;
}

.aliceh-sc__remove {
	width: 28px;
	height: 32px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: #9ca3af;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.aliceh-sc__remove:hover {
	background: #fee2e2;
	color: #dc2626;
}

.aliceh-sc__actions {
	margin: 24px 0;
}

.aliceh-sc__submit {
	width: 100%;
	padding: 12px 20px;
	border: 0;
	border-radius: 6px;
	background: #2563eb;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.aliceh-sc__submit:hover {
	background: #1d4ed8;
}

.aliceh-sc__message {
	margin-bottom: 16px;
	font-size: 13px;
}

.aliceh-sc__message.is-error {
	padding: 10px 12px;
	border-radius: 4px;
	background: #fef2f2;
	color: #b91c1c;
}

.aliceh-sc__message.is-info {
	color: #6b7280;
}

.aliceh-sc__summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 8px;
	margin: 0 0 16px;
}

.aliceh-sc__summary > div {
	padding: 10px 12px;
	background: #f9fafb;
	border-radius: 6px;
}

.aliceh-sc__summary dt {
	color: #6b7280;
	font-size: 12px;
}

.aliceh-sc__summary dd {
	margin: 2px 0 0;
	font-size: 16px;
	font-weight: 600;
}

.aliceh-sc__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.aliceh-sc__table th,
.aliceh-sc__table td {
	padding: 10px 8px;
	border-bottom: 1px solid #e5e7eb;
	text-align: right;
}

.aliceh-sc__table thead th,
.aliceh-sc__table tbody th {
	text-align: left;
	font-weight: 600;
}

.aliceh-sc__table thead th {
	border-bottom-width: 2px;
	color: #6b7280;
	font-size: 12px;
	text-align: right;
}

.aliceh-sc__table thead th:first-child {
	text-align: left;
}

.aliceh-sc__table tr.is-unavailable {
	color: #9ca3af;
}

.aliceh-sc__unavailable {
	font-size: 12px;
	text-align: left;
}

/* FedEx は API 応答待ちの間シマーを表示する。 */
.aliceh-sc__pending {
	text-align: right;
}

.aliceh-sc__shimmer {
	display: inline-block;
	width: 100%;
	max-width: 180px;
	height: 14px;
	border-radius: 3px;
	background: #eef0f3;
	background-image: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%);
	background-size: 200% 100%;
	animation: aliceh-sc-shimmer 1.4s ease-in-out infinite;
	vertical-align: middle;
}

@keyframes aliceh-sc-shimmer {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

/* 視覚効果のみのため、動きを減らす設定では点滅させない。 */
@media (prefers-reduced-motion: reduce) {
	.aliceh-sc__shimmer {
		animation: none;
	}
}

.aliceh-sc__note {
	margin: 12px 0 0;
	color: #6b7280;
	font-size: 12px;
}

@media (max-width: 600px) {
	.aliceh-sc__row {
		grid-template-columns: 1fr 1fr;
	}

	.aliceh-sc__row-index {
		grid-column: 1 / -1;
		padding-bottom: 0;
		text-align: left;
	}

	.aliceh-sc__remove {
		justify-self: end;
	}
}
