figure[data-table-scrollable="sp"] {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

figure[data-table-scrollable="sp"] > table {
	min-width: var(--table-width, 100%);
}

.haruwari-abp-calculator {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 1.5rem 0;
	padding: 1rem;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	background: #f8fafc;
	color: #0f172a;
	font-size: 16px;
	line-height: 1.6;
}

.haruwari-abp-calculator,
.haruwari-abp-calculator * {
	box-sizing: border-box;
}

.haruwari-abp-calculator [hidden] {
	display: none !important;
}

.haruwari-abp-calculator__section {
	min-width: 0;
	margin: 0 0 1rem;
	padding: 1rem;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
}

.haruwari-abp-calculator__section legend {
	width: auto;
	max-width: 100%;
	margin: 0;
	padding: 0 .4rem;
	color: #0f172a;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.4;
}

.haruwari-abp-calculator__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .9rem 1rem;
	min-width: 0;
}

.haruwari-abp-calculator__grid > label {
	display: block;
	min-width: 0;
	margin: 0;
	color: #0f172a;
	font-size: .92rem;
	font-weight: 700;
	line-height: 1.5;
}

.haruwari-abp-calculator input[type="number"] {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	margin: .3rem 0 0;
	padding: .62rem;
	border: 1px solid #64748b;
	border-radius: 6px;
	background: #fff;
	box-shadow: none;
	color: #0f172a;
	font: inherit;
	font-weight: 400;
	line-height: 1.3;
	-webkit-appearance: auto;
	appearance: auto;
}

.haruwari-abp-calculator input[type="number"]:focus {
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, .2);
	outline: 2px solid transparent;
}

.haruwari-abp-calculator__check {
	display: flex !important;
	align-items: center;
	gap: .6rem;
	min-height: 44px;
}

.haruwari-abp-calculator__check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1.2rem;
	height: 1.2rem;
	margin: 0;
	accent-color: #0f766e;
}

.haruwari-abp-calculator__formatted {
	display: block;
	min-height: 1.2em;
	margin-top: .18rem;
	color: #475569;
	font-size: .8rem;
	font-weight: 400;
}

.haruwari-abp-calculator__actions {
	display: flex;
	gap: .75rem;
	flex-wrap: wrap;
}

.haruwari-abp-calculator__button {
	flex: 1 1 180px;
	min-width: 180px;
	min-height: 48px;
	margin: 0;
	padding: .8rem 1rem;
	border: 0;
	border-radius: 7px;
	background: #0f766e;
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.haruwari-abp-calculator__button:hover,
.haruwari-abp-calculator__button:focus-visible {
	background: #115e59;
}

.haruwari-abp-calculator__button:focus-visible {
	box-shadow: 0 0 0 3px rgba(15, 118, 110, .25);
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.haruwari-abp-calculator__button--sub {
	background: #475569;
}

.haruwari-abp-calculator__button--sub:hover,
.haruwari-abp-calculator__button--sub:focus-visible {
	background: #334155;
}

.haruwari-abp-calculator__note {
	margin: .9rem 0 0;
	color: #475569;
	font-size: .85rem;
}

.haruwari-abp-calculator__warning {
	margin: .75rem 0 0;
	padding: .75rem;
	border-left: 4px solid #d97706;
	background: #fffbeb;
	color: #713f12;
}

.haruwari-abp-calculator__results {
	width: 100%;
	max-width: 100%;
	margin-top: 1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.haruwari-abp-calculator__results table {
	width: 100%;
	min-width: 680px;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: #fff;
	font-size: .92rem;
}

.haruwari-abp-calculator__results th,
.haruwari-abp-calculator__results td {
	padding: .55rem;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #0f172a;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	vertical-align: top;
}

.haruwari-abp-calculator__results th {
	font-weight: 700;
}

.haruwari-abp-calculator__results td {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.haruwari-abp-calculator__positive,
.haruwari-abp-calculator__negative {
	font-weight: 700 !important;
}

.haruwari-abp-calculator__positive {
	text-decoration: underline double;
}

.haruwari-abp-calculator__negative {
	text-decoration: underline dashed;
}

@media (max-width: 700px) {
	.haruwari-abp-calculator {
		padding: .75rem;
		font-size: 16px;
	}

	.haruwari-abp-calculator__section {
		padding: .75rem;
	}

	.haruwari-abp-calculator__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.haruwari-abp-calculator__actions {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: .6rem;
	}

	.haruwari-abp-calculator__button {
		width: 100%;
		min-width: 0;
	}
}
