/* TMB Address Autocomplete — floating suggestion panel (front of site). */

.tmb-aac-panel {
	position: fixed;
	z-index: 999999;
	max-height: 280px;
	overflow-y: auto;
	background: #ffffff;
	border: 1px solid #d8dee5;
	border-radius: 10px;
	box-shadow: 0 12px 34px rgba(16, 37, 27, 0.18), 0 2px 6px rgba(16, 37, 27, 0.08);
	padding: 4px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.35;
	color: #1f2937;
	box-sizing: border-box;
	-webkit-overflow-scrolling: touch;
}

.tmb-aac-panel * { box-sizing: border-box; }

.tmb-aac-item {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	padding: 9px 11px;
	border-radius: 7px;
	cursor: pointer;
	color: #1f2937;
}

.tmb-aac-item:hover,
.tmb-aac-item.is-active {
	background: #eef6f1;
}

.tmb-aac-item.is-active {
	box-shadow: inset 0 0 0 1px rgba(69, 181, 81, 0.35);
}

.tmb-aac-pin {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
	opacity: 0.6;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23599534' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.tmb-aac-text {
	flex: 1 1 auto;
	min-width: 0;
	word-break: break-word;
}

.tmb-aac-empty {
	padding: 11px 12px;
	color: #6b7280;
	font-style: italic;
}

.tmb-aac-foot {
	display: none;
	padding: 6px 11px 4px;
	margin-top: 2px;
	border-top: 1px solid #eef2ef;
	font-size: 11px;
	color: #9ca3af;
	text-align: right;
	letter-spacing: 0.02em;
}

/* Instant "searching" state — shown the moment the user types so the panel
   never looks dead while results are being fetched. */
.tmb-aac-loading {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 11px 12px;
	color: #5b6b62;
	font-size: 13px;
}

.tmb-aac-spinner {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	border: 2px solid #d8e3dc;
	border-top-color: #45b551;
	border-radius: 50%;
	animation: tmb-aac-spin 0.6s linear infinite;
}

@keyframes tmb-aac-spin { to { transform: rotate(360deg); } }

/* Thin indeterminate progress bar shown above already-visible results so the
   list doesn't collapse on every keystroke. */
.tmb-aac-bar {
	position: relative;
	height: 2px;
	margin: 2px 4px 4px;
	border-radius: 2px;
	overflow: hidden;
	background: #e7efe9;
}

.tmb-aac-bar::before {
	content: "";
	position: absolute;
	left: -40%;
	top: 0;
	height: 100%;
	width: 40%;
	border-radius: 2px;
	background: #45b551;
	animation: tmb-aac-bar-slide 0.9s ease-in-out infinite;
}

@keyframes tmb-aac-bar-slide {
	0%   { left: -40%; }
	100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.tmb-aac-spinner { animation-duration: 1.4s; }
	.tmb-aac-bar::before { animation-duration: 2s; }
}

/* respect dark-ish form themes minimally — keep panel readable regardless */
@media (prefers-color-scheme: dark) {
	.tmb-aac-panel { color: #1f2937; background: #ffffff; }
}
