/*
 * Koh Samui budget calculator ([tnl_budget]) and its homepage preview ([tnl_budget_teaser]).
 * Only the site's own tokens (tokens.css): powder page, white cards (20 px, the card radius), rock text, muted captions,
 * lagoon-deep for buttons, links and the focus ring, lagoon only for bars and small fills (never text on white).
 * Loaded only on pages whose content uses one of the two shortcodes.
 */
.tnl-budget [hidden], .tnl-bteaser [hidden] { display: none !important; }
.tnl-budget, .tnl-bteaser { font-family: var(--tnl-text); color: var(--tnl-rock); font-variant-numeric: tabular-nums; }
.tnl-budget { max-width: 1180px; margin: 40px auto 0; }
.tnl-budget p, .tnl-bteaser p { margin: 0; }
.tnl-budget__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.tnl-budget__form, .tnl-budget__results, .tnl-budget__detail { padding: 28px; border: 1px solid var(--tnl-line); border-radius: 20px; background: var(--tnl-white); }
.tnl-budget__results { position: sticky; top: 24px; }
.entry-content .tnl-budget .tnl-budget__h, .tnl-budget__h {
	margin: 0 0 18px;
	font-family: var(--tnl-display);
	font-weight: 600;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--tnl-pine);
}
.entry-content .tnl-budget .tnl-budget__h3 { margin: 18px 0 8px; font-family: var(--tnl-display); font-weight: 600; font-size: 19px; line-height: 1.3; color: var(--tnl-pine); text-transform: none; letter-spacing: 0; }

/* Fields */
.tnl-bf { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.tnl-bf__l, .tnl-bf > legend.tnl-bf__l { display: block; margin: 0 0 8px; padding: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--tnl-pine); }
.tnl-budget .tnl-bf__select, .tnl-budget .tnl-bf__num, .tnl-bteaser .tnl-bf__select {
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--tnl-line);
	border-radius: 12px;
	background-color: var(--tnl-white);
	color: var(--tnl-rock);
	font: 500 16px/1.2 var(--tnl-text);
	box-shadow: none;
}
.tnl-budget .tnl-bf__select, .tnl-bteaser .tnl-bf__select {
	padding-right: 40px;
	background: var(--tnl-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%230B6E6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") right 14px center / 12px 8px no-repeat;
	appearance: none;
	-webkit-appearance: none;
}
.tnl-budget :is(input, select, button, summary, a):focus-visible, .tnl-bteaser :is(input, select, button):focus-visible { outline: 3px solid var(--tnl-lagoon-deep); outline-offset: 2px; }
.tnl-bf__hint { margin-top: 6px !important; font-size: 13px; line-height: 1.5; color: var(--tnl-muted); }
.tnl-bf__hint a { color: var(--tnl-lagoon-deep); }
.tnl-bf__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tnl-bf--group { margin-top: 6px; padding: 16px 16px 0; border: 1px solid var(--tnl-line); border-radius: 14px; }
.tnl-bf__cond > :first-child { margin-top: 12px; }
.tnl-bf__range { display: flex; align-items: center; gap: 14px; }
.tnl-bf__range input { flex: 1; min-width: 0; height: 32px; margin: 0; accent-color: var(--tnl-lagoon-deep); }
.tnl-bf__range output { min-width: 92px; font-weight: 600; color: var(--tnl-pine); }
.tnl-bf__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tnl-pill { position: relative; display: inline-flex; margin: 0; }
.tnl-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tnl-pill span {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--tnl-line);
	border-radius: 999px;
	background: var(--tnl-white);
	font-size: 15px;
	font-weight: 600;
	color: var(--tnl-rock);
}
.tnl-pill input:checked + span { border-color: var(--tnl-lagoon-deep); background: var(--tnl-lagoon-deep); color: var(--tnl-white); }
.tnl-pill input:focus-visible + span { outline: 3px solid var(--tnl-lagoon-deep); outline-offset: 2px; }
.tnl-pill input:focus-visible { outline: 0; }
.tnl-pill--s span { min-height: 32px; padding: 0 11px; font-size: 13px; }

/* Calm notes and "From my own stay" */
.tnl-bnote, .tnl-budget__warn li { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--tnl-lagoon-tint); font-size: 14px; line-height: 1.5; color: var(--tnl-rock); }
.tnl-bnote svg, .tnl-budget__warn svg { flex: none; margin-top: 1px; color: var(--tnl-lagoon-deep); }
.tnl-bown { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--tnl-powder-2); font-size: 14px; line-height: 1.55; }
.tnl-bown svg { flex: none; margin-top: 2px; color: var(--tnl-pine); }
.tnl-bown__c { margin-top: 4px !important; font-size: 13px; color: var(--tnl-muted); }

.tnl-budget__more { margin-top: 6px; border-top: 1px solid var(--tnl-line); }
.tnl-budget__more > summary, .tnl-budget__how > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	list-style: none;
	font-size: 16px;
	font-weight: 600;
	color: var(--tnl-lagoon-deep);
	cursor: pointer;
}
.tnl-budget__more > summary::-webkit-details-marker, .tnl-budget__how > summary::-webkit-details-marker { display: none; }
.tnl-budget__more > summary::after, .tnl-budget__how > summary::after { content: ""; width: 9px; height: 9px; margin: -4px 4px 0 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.tnl-budget__more[open] > summary::after, .tnl-budget__how[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.tnl-budget__more-in { padding-top: 8px; }

/* Results */
.tnl-bcur { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 14px; padding: 0; border: 0; }
.tnl-bcur legend { float: left; margin: 0 4px 0 0; padding: 0; font-size: 13px; color: var(--tnl-muted); }
.tnl-budget__headline { min-height: 72px; font-family: var(--tnl-display); font-weight: 600; font-size: 30px; line-height: 1.2; color: var(--tnl-pine); }
.tnl-budget__thb { display: block; margin-top: 2px; font-family: var(--tnl-text); font-size: 14px; font-weight: 500; color: var(--tnl-muted); }
.tnl-budget__sub { margin-top: 6px !important; font-size: 14px; color: var(--tnl-muted); }
.tnl-budget__tiles { display: grid; gap: 10px; margin-top: 18px; }
.tnl-budget__tile { padding: 14px 16px; border-radius: 14px; background: var(--tnl-powder); }
.tnl-budget__tile-h { font-size: 13px; font-weight: 600; color: var(--tnl-pine); }
.tnl-budget__tile-v { margin-top: 4px !important; font-family: var(--tnl-display); font-weight: 600; font-size: 22px; line-height: 1.2; color: var(--tnl-pine); }
.tnl-budget__tile-v .tnl-budget__thb { font-size: 13px; }
.tnl-budget__tile-c { margin-top: 4px !important; font-size: 13px; color: var(--tnl-muted); }
.tnl-budget__total, .tnl-budget__rate { margin-top: 14px !important; font-size: 14px; line-height: 1.55; }
.tnl-budget__total .tnl-budget__thb { display: inline; }
.tnl-budget__rate { color: var(--tnl-muted); }
.tnl-budget__drivers { margin-top: 16px; }
.tnl-budget__drivers-t { font-size: 14px; line-height: 1.5; }
.tnl-budget__bar { display: flex; height: 10px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: var(--tnl-powder-2); }
.tnl-budget__seg--1 { background: var(--tnl-pine); }
.tnl-budget__seg--2 { background: var(--tnl-lagoon-deep); }
.tnl-budget__seg--3 { background: var(--tnl-lagoon); }
.tnl-budget__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tnl-budget__btn {
	min-height: 48px;
	padding: 0 20px;
	border: 2px solid var(--tnl-lagoon-deep);
	border-radius: 999px;
	background: var(--tnl-lagoon-deep);
	color: var(--tnl-white);
	font: 600 15px/1 var(--tnl-text);
	cursor: pointer;
}
.tnl-budget__btn:hover { border-color: var(--tnl-lagoon-deep-hover); background: var(--tnl-lagoon-deep-hover); }
.tnl-budget__btn--quiet { background: var(--tnl-white); color: var(--tnl-lagoon-deep); }
.tnl-budget__btn--quiet:hover { background: var(--tnl-lagoon-tint); color: var(--tnl-lagoon-deep-hover); }
.tnl-budget__status { flex-basis: 100%; min-height: 20px; font-size: 14px; color: var(--tnl-muted); }
.tnl-budget__copyfield { flex-basis: 100%; display: grid; gap: 6px; font-size: 13px; }
.tnl-budget__copyfield input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--tnl-line); border-radius: 10px; font: 500 14px var(--tnl-text); color: var(--tnl-rock); }

/* Line by line */
.tnl-budget__detail { margin-top: 28px; }
.tnl-budget__warn { margin: 0 0 18px; padding: 0; list-style: none; }
.tnl-budget__warn li:first-child { margin-top: 0; }
.tnl-budget__table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 15px; }
.tnl-budget__table caption { padding: 0 0 12px; caption-side: top; text-align: left; font-family: var(--tnl-display); font-weight: 600; font-size: 22px; color: var(--tnl-pine); }
.tnl-budget__table :is(th, td) { padding: 12px 10px; border: 0; border-bottom: 1px solid var(--tnl-line); background: none; text-align: left; vertical-align: top; }
.tnl-budget__table thead th { font-size: 13px; font-weight: 600; color: var(--tnl-muted); }
.tnl-budget__table tbody th { font-weight: 600; color: var(--tnl-pine); }
.tnl-budget__table .tnl-budget__thb { font-size: 12px; }
.tnl-budget__sum :is(th, td) { border-top: 2px solid var(--tnl-pine); border-bottom: 0; font-weight: 700; color: var(--tnl-pine); }
.tnl-budget__tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--tnl-powder-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tnl-budget__link { display: block; margin: 4px 0 0; padding: 4px 0; border: 0; background: none; color: var(--tnl-lagoon-deep); font: 600 13px/1.3 var(--tnl-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tnl-budget__quote { display: grid; gap: 4px; max-width: 240px; margin-top: 8px; font-weight: 500; }
.tnl-budget__quote label { font-size: 12px; color: var(--tnl-muted); }
.tnl-budget__quote input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--tnl-line); border-radius: 10px; font: 500 15px var(--tnl-text); color: var(--tnl-rock); }
.tnl-budget__deposits-w, .tnl-budget__before, .tnl-budget__inc { margin-top: 14px; font-size: 14px; line-height: 1.6; }
.tnl-budget__how { margin-top: 18px; border-top: 1px solid var(--tnl-line); }
.tnl-budget__how-in { padding-bottom: 6px; font-size: 15px; line-height: 1.6; }
.tnl-budget__how-in ul { margin: 0; padding-left: 1.2em; }
.tnl-budget__how-in li + li { margin-top: 6px; }
.entry-content .tnl-article .tnl-budget-sources { font-size: 15px; }
.tnl-budget a { color: var(--tnl-lagoon-deep); text-underline-offset: 3px; }
.tnl-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tnl-badge--high { background: var(--tnl-lagoon-tint); color: var(--tnl-lagoon-deep); }
.tnl-badge--medium { background: var(--tnl-powder-2); color: var(--tnl-rock); }
.tnl-badge--low { background: var(--tnl-mango-tint); color: var(--tnl-mango-deep); }
.tnl-budget__foot { margin-top: 18px !important; font-size: 13px; line-height: 1.55; color: var(--tnl-muted); }

/* Phones: one column, a slim bar with the headline while the results are out of view */
.tnl-budget__sticky {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 40;
	display: flex;
	justify-content: center;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	background: var(--tnl-pine);
	color: var(--tnl-white) !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 -8px 24px rgba(var(--tnl-shade), .18);
}
@media (max-width: 899px) {
	.tnl-budget { margin-top: 28px; }
	.tnl-budget__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.tnl-budget__results { position: static; }
	.tnl-budget__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 689px) {
	.tnl-budget__form, .tnl-budget__results, .tnl-budget__detail { padding: 20px 16px; border-radius: 16px; }
	.tnl-budget__tiles { grid-template-columns: minmax(0, 1fr); }
	.tnl-budget__headline { min-height: 0; font-size: 26px; }
	.tnl-bf__pair { grid-template-columns: minmax(0, 1fr); }
	.tnl-budget__table thead { display: none; }
	.tnl-budget__table, .tnl-budget__table tbody, .tnl-budget__table tr, .tnl-budget__table th, .tnl-budget__table td { display: block; }
	.tnl-budget__table tr { padding: 12px 0; border-bottom: 1px solid var(--tnl-line); }
	.tnl-budget__table :is(th, td) { padding: 2px 0; border: 0; }
	.tnl-budget__table td::before { content: attr(data-l) ": "; font-size: 13px; color: var(--tnl-muted); }
	.tnl-budget__table td:empty { display: none; }
	.tnl-budget__sum { border-top: 2px solid var(--tnl-pine); border-bottom: 0 !important; }
	.tnl-budget__sum :is(th, td) { border-top: 0; }
}

/* Homepage preview */
.tnl-bteaser { margin: 0 !important; padding: 88px 56px; background: var(--tnl-powder-2); }
.tnl-bteaser__card {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 48px;
	align-items: center;
	max-width: 1180px;
	margin: 0 auto;
	padding: 48px;
	border-radius: 24px;
	background: var(--tnl-white);
	box-shadow: 0 24px 60px rgba(var(--tnl-shade), .08);
}
.tnl-bteaser .tnl-eyebrow { letter-spacing: 2.6px; color: var(--tnl-mango-deep); }
.tnl-bteaser .tnl-bteaser__h { margin: 10px 0 0; font-family: var(--tnl-display); font-weight: 600; font-size: 40px; line-height: 1.15; letter-spacing: 0; text-transform: none; color: var(--tnl-pine); }
.tnl-bteaser__lead { margin-top: 14px !important; font-size: 17px; line-height: 1.6; }
.tnl-bteaser__form { display: grid; gap: 4px; }
.tnl-bteaser__form .tnl-bf { margin-bottom: 14px; }
.tnl-bteaser__result { min-height: 40px; font-family: var(--tnl-display); font-weight: 600; font-size: 30px; line-height: 1.25; color: var(--tnl-pine); }
.tnl-bteaser__note { margin: 6px 0 16px !important; font-size: 13px; line-height: 1.5; color: var(--tnl-muted); }
.tnl-bteaser__btn {
	justify-self: start;
	min-height: 52px;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background: var(--tnl-lagoon);
	color: var(--tnl-ink);
	font: 600 16px/1 var(--tnl-text);
	cursor: pointer;
}
.tnl-bteaser__btn:hover { background: var(--tnl-lagoon-light); }
@media (max-width: 999px) {
	.tnl-bteaser { padding: 72px 32px; }
	.tnl-bteaser__card { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 40px; }
}
@media (max-width: 689px) {
	.tnl-bteaser { padding: 64px 16px; }
	.tnl-bteaser__card { padding: 28px 20px; border-radius: 20px; }
	.tnl-bteaser .tnl-bteaser__h { font-size: 30px; }
	.tnl-bteaser__lead { font-size: 16px; }
	.tnl-bteaser__result { font-size: 26px; }
	.tnl-bteaser__btn { justify-self: stretch; }
}
