.tit-calculator {
	max-width: 480px;
	margin: 1.5em 0;
	padding: 1.5em;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.06 );
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

.tit-calculator * {
	box-sizing: border-box;
}

.tit-title {
	margin: 0 0 1em;
	font-size: 1.2em;
	font-weight: 700;
}

.tit-field {
	margin-bottom: 0.9em;
}

.tit-field-row {
	display: flex;
	gap: 0.8em;
}

.tit-field-row .tit-field {
	flex: 1 1 0;
}

.tit-field label {
	display: block;
	margin-bottom: 0.3em;
	font-weight: 600;
	font-size: 0.9em;
	color: #1e1e1e;
}

.tit-hint {
	display: block;
	margin-top: 0.3em;
	font-size: 0.78em;
	color: #787c82;
	line-height: 1.35;
}

.tit-input {
	width: 100%;
	padding: 0.55em 0.7em;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	font-size: 1em;
	background: #fff;
	color: #1e1e1e;
}

.tit-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

/* Category dropdown + country search: show a chevron so users know it opens. */
select.tit-input,
.tit-combo-input {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 2.4em;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2350575e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8em center;
	background-size: 1.05em;
}

.tit-combo-input {
	cursor: text;
}

select.tit-input::-ms-expand {
	display: none;
}

/* Searchable country combobox. */
.tit-combo {
	position: relative;
}

.tit-combo-list {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	top: calc( 100% + 3px );
	margin: 0;
	padding: 4px;
	list-style: none;
	max-height: 240px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.14 );
}

.tit-combo-option {
	padding: 0.5em 0.7em;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tit-combo-option:hover,
.tit-combo-option.is-active {
	background: #2271b1;
	color: #fff;
}

.tit-submit {
	width: 100%;
	margin-top: 0.4em;
	padding: 0.7em 1em;
	border: 0;
	border-radius: 6px;
	background: #2271b1;
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.tit-submit:hover {
	background: #135e96;
}

.tit-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.tit-result {
	margin-top: 1.4em;
	padding-top: 1.2em;
	border-top: 1px solid #e2e4e7;
}

.tit-breakdown {
	width: 100%;
	border-collapse: collapse;
}

.tit-breakdown th,
.tit-breakdown td {
	padding: 0.5em 0;
	text-align: left;
	font-weight: 400;
	vertical-align: top;
	border-bottom: 1px solid #f0f0f1;
}

.tit-breakdown td {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.tit-breakdown .tit-muted th,
.tit-breakdown .tit-muted td {
	color: #787c82;
}

.tit-breakdown .tit-subtotal th,
.tit-breakdown .tit-subtotal td {
	font-weight: 600;
}

.tit-breakdown .tit-total th,
.tit-breakdown .tit-total td {
	font-weight: 700;
	font-size: 1.1em;
	color: #135e96;
	border-bottom: 0;
}

.tit-breakdown .tit-error td {
	color: #d63638;
	text-align: left;
}

.tit-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-top: 1.2em;
	padding-top: 1em;
	border-top: 1px solid #f0f0f1;
}

.tit-share-label {
	font-size: 0.85em;
	font-weight: 600;
	color: #50575e;
	margin-right: 0.2em;
}

.tit-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	background: #6c7781;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.12s ease, opacity 0.12s ease;
}

.tit-share-btn:hover {
	transform: translateY( -1px );
	opacity: 0.92;
}

.tit-share-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.tit-share-facebook { background: #1877f2; }
.tit-share-line     { background: #06c755; }
.tit-share-x        { background: #000; }
.tit-share-whatsapp { background: #25d366; }
.tit-share-copy     { background: #6c7781; width: auto; padding: 0 0.9em; border-radius: 18px; }

.tit-share-copy.is-copied { background: #06c755; }

.tit-copied {
	font-size: 0.85em;
	font-weight: 600;
	white-space: nowrap;
}

.tit-disclaimer {
	margin: 1.2em 0 0;
	font-size: 0.8em;
	color: #787c82;
	line-height: 1.4;
}

/* Responsive: stack side-by-side fields and tighten padding on small screens. */
@media ( max-width: 480px ) {
	.tit-calculator {
		padding: 1.15em;
		border-radius: 8px;
	}
	.tit-field-row {
		flex-direction: column;
		gap: 0;
	}
	.tit-field-row .tit-field {
		margin-bottom: 0.9em;
	}
	.tit-input,
	.tit-submit {
		font-size: 16px; /* prevents iOS auto-zoom on focus */
	}
	.tit-breakdown th,
	.tit-breakdown td {
		font-size: 0.95em;
	}
	.tit-share {
		justify-content: center;
	}
	/* Bigger, comfortable touch targets for the country list on mobile. */
	.tit-combo-list {
		max-height: 50vh;
	}
	.tit-combo-option {
		padding: 0.7em 0.8em;
		font-size: 1em;
	}
}

@media ( prefers-color-scheme: dark ) {
	.tit-calculator {
		background: #1e1e1e;
		border-color: #3c3c3c;
	}
	/* Lighter chevron for dark backgrounds. */
	select.tit-input,
	.tit-combo-input {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b8b8b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	}
	.tit-combo-list {
		background: #2a2a2a;
		border-color: #4a4a4a;
	}
	.tit-combo-option {
		color: #e8e8e8;
	}
	.tit-title,
	.tit-field label,
	.tit-input {
		color: #e8e8e8;
	}
	.tit-input {
		background: #2a2a2a;
		border-color: #4a4a4a;
	}
	.tit-result,
	.tit-breakdown th,
	.tit-breakdown td {
		border-color: #3c3c3c;
	}
	.tit-breakdown .tit-total th,
	.tit-breakdown .tit-total td {
		color: #6cb6ff;
	}
	.tit-share {
		border-color: #3c3c3c;
	}
	.tit-share-label {
		color: #b8b8b8;
	}
	.tit-share-x {
		background: #333;
	}
}
