/* Cities, districts and activities typed with suggestions (Habaru 1.10). Colours come from the theme. */
.ref-field { position: relative; }
.ref-field [hidden], .ref-subs [hidden] { display: none !important; }
.ref-box { position: relative; }
.ref-box .input { padding-right: 44px; }
.ref-spin {
	position: absolute; right: 14px; top: 14px; width: 18px; height: 18px; border-radius: 50%;
	border: 2.5px solid var(--green-soft, #CBE8D0); border-top-color: var(--green, #0B861C);
	animation: ref-spin .8s linear infinite;
}
@keyframes ref-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ref-spin { animation: none; } }

.ref-list {
	list-style: none; margin: 4px 0 0; padding: 0; max-height: min(320px, 50vh); overflow-y: auto;
	background: var(--surface, #fff); border: 1px solid var(--line-strong, #D6D0C2); border-radius: 12px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .10); position: relative; z-index: 20;
}
.ref-list[hidden] { display: none; }
.ref-opt {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	min-height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--line, #E6E1D6); cursor: pointer;
}
.ref-opt:last-child { border-bottom: 0; }
.ref-opt[aria-selected="true"], .ref-opt:hover { background: var(--green-tint, #E5F4E7); }
.ref-opt__main { display: flex; flex-direction: column; min-width: 0; }
.ref-opt__name { font-size: 15px; overflow-wrap: anywhere; }
.ref-opt__name mark { background: none; color: inherit; font-weight: 700; }
.ref-opt__sub { font-size: 12px; color: var(--muted, #5E6656); }
.ref-opt .status { flex: none; white-space: nowrap; }
.ref-opt--add { font-weight: 700; color: var(--green-dark, #086515); }
.ref-msg { padding: 10px 12px; font-size: 14px; color: var(--muted, #5E6656); background: var(--field, #F4F2EC); border-bottom: 1px solid var(--line, #E6E1D6); }

.ref-chosen {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px;
	padding: 8px 12px; border: 1px solid var(--green-soft, #CBE8D0); background: var(--green-tint, #E5F4E7); border-radius: 10px;
}
.ref-chosen[hidden] { display: none; }
.ref-chosen--wait { border-color: var(--orange-soft, #FFDDB0); background: var(--orange-tint, #FFF0DC); }
.ref-chosen__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ref-chosen__text b { font-size: 15px; overflow-wrap: anywhere; }
.ref-chosen__text small { font-size: 12px; color: var(--muted, #5E6656); }
.ref-chosen__text .status { align-self: flex-start; }
.ref-chosen .link-btn { flex: none; min-height: 44px; font-weight: 700; }

.ref-ok { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--green-tint, #E5F4E7); color: var(--green-dark, #086515); font-weight: 600; font-size: 14px; }
.ref-ok[hidden] { display: none; }

.ref-panel, .ref-subnew {
	margin-top: 10px; padding: 14px; border: 1px solid var(--line-strong, #D6D0C2); border-radius: 14px;
	background: var(--surface, #fff); display: flex; flex-direction: column; gap: 10px;
}
.ref-panel[hidden], .ref-subnew[hidden], .ref-similar[hidden], [data-ref-for][hidden] { display: none; }
.ref-panel__title { margin: 0; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.ref-panel .field, .ref-subnew .field { margin: 0; }
.ref-radio { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px; border: 1px solid var(--line, #E6E1D6); border-radius: 10px; font-size: 14px; cursor: pointer; }
.ref-radio:has(input:checked) { border-color: var(--green, #0B861C); background: var(--green-tint, #E5F4E7); }
.ref-radio input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--green, #0B861C); flex: none; }
.ref-radio span { display: flex; flex-direction: column; }
.ref-radio small { color: var(--muted, #5E6656); font-size: 13px; }
.ref-panel__buttons { display: flex; gap: 8px; }
.ref-panel__buttons .btn { flex: 1; }
.ref-similar { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--orange-tint, #FFF0DC); color: var(--ink, #16260F); }
.ref-similar .link-btn { font-weight: 700; }

.ref-subs { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.ref-subs[hidden] { display: none; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px;
	border: 1px solid var(--line-strong, #D6D0C2); background: var(--surface, #fff); font: inherit; font-size: 14px; color: var(--ink, #16260F); cursor: pointer;
}
.ref-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ref-chip:has(input:focus-visible) { outline: 3px solid var(--green-soft, #CBE8D0); outline-offset: 2px; }
.ref-chip.is-on, .ref-chip:has(input:checked) { background: var(--green-tint, #E5F4E7); border-color: var(--green, #0B861C); color: var(--green-dark, #086515); font-weight: 700; }
.ref-chip.is-on span:first-of-type::before, .ref-chip:has(input:checked) span:first-of-type::before { content: "✓ "; }
.ref-chip:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.ref-chip--add { border-style: dashed; color: var(--green-dark, #086515); font-weight: 700; }
.ref-chip--add[hidden] { display: none; }
.ref-chip--wait { border-color: var(--orange-soft, #FFDDB0); background: var(--orange-tint, #FFF0DC); cursor: default; }
