/* ==========================================================================
   Address search (Peter, 7 Oct 2026)
   The suggestion list under an address field: the .tx-dd__menu look (white,
   hairline, the field-attached shadow, grey hover and keyboard row). JS in
   src/js/address-search.js (window.bulletAddressSearch). Catalogued at
   preview/index.html#addresssearch.
   Works in the app AND the onboarding: each value reads the app's token and
   falls back to the onboarding's own (the onboarding never loads app sheets).
   ========================================================================== */
.addr-search {
  --as-surface: var(--color-surface, var(--bg-white, #fff));
  --as-border: var(--color-border, var(--border-primary, #ececec));
  --as-hover: var(--color-bg-subtle, var(--bg-subtle, #f5f5f5));
  --as-text: var(--color-text, var(--ink, #2c2c2c));
  --as-muted: var(--color-text-muted, var(--text-secondary, #757575));
  --as-size: var(--text-sm, var(--fs-subhead, 14px));
  --as-small: var(--text-xs, var(--fs-footnote, 12px));
  --as-radius: var(--radius-md, var(--radius-sm, 8px));
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.addr-search > input { width: 100%; box-sizing: border-box; }
.addr-search > input[aria-busy="true"] { cursor: progress; }

.addr-search__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  box-sizing: border-box;
  max-height: min(400px, 60vh); overflow-y: auto;
  padding: 8px;
  background: var(--as-surface);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius);
  box-shadow: 0 8px 24px rgba(12, 12, 13, 0.14);   /* the .tx-dd__menu field-attached shadow */
  text-align: left;
}
.addr-search__list[hidden] { display: none; }

.addr-search__item {
  display: flex; align-items: flex-start; gap: 10px;
  min-height: 38px; padding: 9px 12px;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--as-size); line-height: 1.35;
  color: var(--as-text);
  cursor: pointer;
}
.addr-search__item > svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--as-muted); }
.addr-search__item:hover,
.addr-search__item.is-active { background: var(--as-hover); }
.addr-search__text { display: flex; flex-direction: column; min-width: 0; }
.addr-search__main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-search__sub { color: var(--as-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-search__item--manual { color: var(--as-muted); }
.addr-search__item--manual:hover,
.addr-search__item--manual.is-active { color: var(--as-text); }

.addr-search__empty { margin: 4px 12px 6px; font-size: var(--as-size); color: var(--as-muted); }
.addr-search__note { margin: 6px 12px 2px; font-size: var(--as-small); color: var(--as-muted); }

/* a Northern Irish pick where only the Republic will do (a business's own registered office or business address,
   the CRO rule): the plain line under the field, the app's danger colour (the onboarding's own as the fallback) */
.addr-search__msg {
  margin: 6px 0 0;
  font-size: var(--as-size); line-height: 1.4;
  color: var(--color-danger, var(--danger-fg, #c81e1e));
}
.addr-search__msg[hidden] { display: none; }
.addr-search__msg--hint { color: var(--as-muted); }   /* "Add the street." after a town on its own: a nudge, not an error */

/* THE PICKED LINE (Peter, 9 Oct 2026): after a pick, where it is ("Ballsbridge, Dublin 4 · D04 T2T0") in quiet type,
   and the one-press way back to typing. Two streets share a name; the area tells them apart. */
.addr-search__picked {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin: 6px 0 0;
  font-size: var(--as-size); line-height: 1.4;
  color: var(--as-muted);
}
.addr-search__picked[hidden] { display: none; }
.addr-search__where { min-width: 0; }
.addr-search__redo {
  padding: 0; border: 0; background: none;
  font: inherit; color: var(--as-text);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.addr-search__redo:hover { text-decoration-thickness: 2px; }
.addr-search__redo:focus-visible { outline: 2px solid var(--color-focus, var(--as-text)); outline-offset: 2px; border-radius: 2px; }
