/*
 * 売ったら手元にいくら残るか（/sell/tedori/、inc/tedori.php）。2026-10-26 見本 docs/記録/手取り試作_1
 */

.msreal-td {
	--td-line: #e3dccd;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	gap: 32px;
	align-items: start;
	max-width: 1080px;
	margin: 0 auto;
	padding: 32px 16px 72px;
}

.msreal-td-card {
	min-width: 0;
	border: 1px solid var(--td-line);
	border-radius: 12px;
	background: #fff;
	padding: 24px;
}

.msreal-td-card h2,
.msreal-td-card h3 {
	margin: 0;
	color: var(--wp--preset--color--ai);
	font-family: var(--wp--preset--font-family--maru);
	font-weight: 700;
	line-height: 1.5;
}

.msreal-td-card h2 {
	font-size: 1.2rem;
}

.msreal-td-card h3 {
	font-size: 1.05rem;
}

.msreal-td-sub {
	margin: 4px 0 0;
	color: #666;
	font-size: 0.82rem;
}

.msreal-td-f {
	min-width: 0;
	margin-top: 16px;
}

.msreal-td-f > label,
.msreal-td-lab {
	display: block;
	margin-bottom: 6px;
	color: var(--wp--preset--color--ai);
	font-size: 0.88rem;
	font-weight: 700;
}

.msreal-td-f small {
	display: block;
	margin-top: 4px;
	color: #777;
	font-size: 0.75rem;
	line-height: 1.6;
}

.msreal-td-num {
	display: flex;
	align-items: center;
	gap: 8px;
}

.msreal-td-num input {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: 48px;
	border: 1px solid #bdb3a0;
	border-radius: 6px;
	padding: 0 12px;
	font-family: inherit;
	font-size: 18px;
	text-align: right;
}

.msreal-td-num input:disabled {
	background: #f1efea;
	color: #aaa;
}

.msreal-td-num span {
	font-size: 0.88rem;
	white-space: nowrap;
}

.msreal-td-seg {
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: 6px;
}

.msreal-td-seg.is-st {
	grid-template-columns: 1fr 1fr 1fr 1.6fr;
	grid-auto-flow: row;
}

.msreal-td-seg label {
	position: relative;
	border: 1px solid #cfc3ab;
	border-radius: 6px;
	background: #fff;
	padding: 10px 4px;
	color: var(--wp--preset--color--ai);
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
}

.msreal-td-seg.is-mode label {
	padding: 12px 4px;
}

.msreal-td-seg small {
	display: block;
	margin: 0;
	color: inherit;
	font-size: 0.72rem;
	font-weight: 400;
	opacity: 0.85;
}

.msreal-td-seg input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.msreal-td-seg label:has(input:checked) {
	border-color: var(--wp--preset--color--ai);
	background: var(--wp--preset--color--ai);
	color: #fff;
}

.msreal-td-seg label:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--shinchu);
	outline-offset: 2px;
}

.msreal-td-two {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0 16px;
}

.msreal-td-chk {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	color: #555;
	font-size: 0.85rem;
	cursor: pointer;
}

.msreal-td-more {
	margin-top: 24px;
	border-top: 1px dashed var(--td-line);
	padding-top: 20px;
}

.msreal-td-more > p {
	margin: 4px 0 0;
	color: #666;
	font-size: 0.82rem;
}

/* 結果 */
.msreal-td-res {
	position: sticky;
	top: 16px;
	border-radius: 12px;
	background: var(--wp--preset--color--ai);
	padding: 24px;
	color: #fff;
}

.msreal-td-res__lab {
	color: #d9c39c;
	font-size: 0.8rem;
	font-weight: 700;
}

.msreal-td-res__big {
	margin: 2px 0 4px;
	font-family: var(--wp--preset--font-family--maru);
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
}

.msreal-td-res__big small {
	margin-left: 4px;
	font-size: 18px;
}

.msreal-td-res__note {
	margin: 0 0 16px;
	color: #cfd5de;
	font-size: 0.78rem;
}

.msreal-td-bar {
	display: flex;
	overflow: hidden;
	height: 14px;
	margin-bottom: 6px;
	border-radius: 7px;
	background: #2b3b55;
}

.msreal-td-bar i {
	display: block;
	height: 100%;
}

.msreal-td-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-bottom: 14px;
	color: #cfd5de;
	font-size: 0.72rem;
}

.msreal-td-legend span::before {
	content: "";
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 4px;
	border-radius: 2px;
	background: var(--c);
}

.msreal-td-rows {
	margin: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.18);
	scroll-margin-top: 80px;
}

.msreal-td-rows div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	padding: 8px 0;
	font-size: 0.88rem;
}

.msreal-td-rows dt {
	margin: 0;
	color: #e9e2d4;
}

.msreal-td-rows dd {
	margin: 0;
	font-weight: 700;
	white-space: nowrap;
}

.msreal-td-rows .is-total dt,
.msreal-td-rows .is-total dd {
	color: #fff;
	font-size: 0.95rem;
}

.msreal-td-msgs {
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	color: #e9e2d4;
	font-size: 0.78rem;
}

.msreal-td-msgs li {
	position: relative;
	margin-top: 6px;
	padding-left: 14px;
	line-height: 1.7;
}

.msreal-td-msgs li::before {
	content: "";
	position: absolute;
	top: 0.7em;
	left: 2px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--shinchu);
}

.msreal-td-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	margin-top: 18px;
	border-radius: 999px;
	background: linear-gradient(#c4a068, #b8935a);
	box-shadow: 0 4px 0 #8a6a35;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.msreal-td-cta:hover,
.msreal-td-cta:focus-visible {
	color: #fff;
	filter: brightness(1.05);
}

.msreal-td-cta-sub {
	margin: 8px 0 0;
	color: #cfd5de;
	font-size: 0.75rem;
	text-align: center;
}

.msreal-td-sticky {
	display: none;
}

.msreal-td-fine {
	max-width: 1080px;
	margin: -40px auto 0;
	padding: 0 16px 56px;
	color: #666;
	font-size: 0.78rem;
}

.msreal-td-fine h2 {
	margin: 0 0 6px;
	color: var(--wp--preset--color--ai);
	font-size: 1rem;
}

.msreal-td-fine ul {
	margin: 0;
	padding-left: 1.2em;
}

@media (max-width: 860px) {
	.msreal-td {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
		padding-top: 20px;
	}

	.msreal-td-card {
		padding: 18px;
	}

	.msreal-td-res {
		position: static;
	}

	.msreal-td-res__big {
		font-size: 34px;
	}

	/* スマホは画面下に手取り。いつもの「無料査定・電話」のバーの代わり */
	.msreal-td-sticky {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 50;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: var(--wp--preset--color--ai);
		box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		color: #fff;
		font-size: 0.8rem;
	}

	.msreal-td-sticky b {
		margin: 0 2px 0 6px;
		font-family: var(--wp--preset--font-family--maru);
		font-size: 22px;
	}

	.msreal-td-sticky a {
		color: #d9c39c;
		font-weight: 700;
		text-decoration: none;
	}

	body:has(.msreal-td-sticky) .msreal-mobile-cta {
		display: none;
	}
}

/* 320px ほどの狭い画面：選ぶボタンの文字（マンションなど）が2行に割れないように */
@media (max-width: 360px) {
	.msreal-td-card {
		padding: 14px;
	}

	.msreal-td-seg label {
		padding-inline: 2px;
		font-size: 0.8rem;
	}

	.msreal-td-two {
		gap: 0 10px;
	}
}

/* 建物の造り（4つ）は、スマホでは2つずつ2段 */
@media (max-width: 860px) {
	.msreal-td-seg.is-st {
		grid-template-columns: 1fr 1fr;
	}
}

/* くわしい解説（2026-10-26） */
.msreal-td-guide {
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	padding: 8px 16px 64px;
	font-size: 0.95rem;
}

.msreal-td-guide h2 {
	margin: 0 0 8px;
	color: var(--wp--preset--color--ai);
	font-family: var(--wp--preset--font-family--maru);
	font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.5rem);
	font-weight: 700;
}

.msreal-td-guide h3 {
	margin: 32px 0 8px;
	border-left: 4px solid var(--wp--preset--color--shinchu);
	padding-left: 10px;
	color: var(--wp--preset--color--ai);
	font-family: var(--wp--preset--font-family--maru);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.5;
}

.msreal-td-guide p,
.msreal-td-guide ul {
	margin: 8px 0 0;
}

.msreal-td-guide ul {
	padding-left: 1.3em;
}

.msreal-td-guide__lead {
	color: #555;
}

.msreal-td-guide__formula {
	border-radius: 8px;
	background: #fff;
	padding: 12px 16px;
	color: var(--wp--preset--color--ai);
	font-weight: 700;
}

.msreal-td-guide__table {
	width: 100%;
	margin-top: 12px;
	border-collapse: collapse;
	background: #fff;
	font-size: 0.9rem;
}

.msreal-td-guide__table th,
.msreal-td-guide__table td {
	border: 1px solid #e3dccd;
	padding: 8px 12px;
	text-align: left;
	vertical-align: top;
}

.msreal-td-guide__table th {
	background: #f7f3eb;
	color: var(--wp--preset--color--ai);
}

.msreal-td-guide__note {
	color: #666;
	font-size: 0.82rem;
}

/* 2026-10-26 磨き：例の数字に戻す・「もっと正確に」の状態・空のときの案内・要約・0円の行 */
.msreal-td-card__head,
.msreal-td-more__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
}

.msreal-td-reset {
	border: 1px solid #cfc3ab;
	border-radius: 999px;
	background: #fff;
	padding: 4px 12px;
	color: #6b5226;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
}

.msreal-td-reset:hover,
.msreal-td-reset:focus-visible {
	background: #f7f3eb;
}

.msreal-td-more__state {
	border-radius: 999px;
	background: #f1efea;
	padding: 2px 10px;
	color: #777;
	font-size: 0.72rem;
	font-weight: 700;
}

.msreal-td-more__state.is-on {
	background: #e8f3ea;
	color: #1f6b3a;
}

.msreal-td-f .msreal-td-warn {
	border-radius: 4px;
	background: #fdf4e3;
	padding: 4px 8px;
	color: #8a5a10;
}

.msreal-td-res__sum {
	margin: 0 0 6px;
	color: #e9e2d4;
	font-size: 0.85rem;
	line-height: 1.7;
}

.msreal-td-res__sum b {
	color: #fff;
}

.msreal-td-rows .is-zero {
	opacity: 0.45;
}

.msreal-td-num input:focus {
	border-color: var(--wp--preset--color--shinchu);
	outline: 2px solid rgba(184, 147, 90, 0.35);
	outline-offset: 0;
}

.msreal-td-f .msreal-td-warn[hidden] {
	display: none;
}
