/* Ticker autocomplete — see js/core/autocomplete.js.

   The panel lives on <body> and is position: fixed, so nothing here may make
   it position: absolute. Three of the four inputs sit in a toolbar with
   overflow-x: auto, which clips an absolutely-positioned child on both axes. */

.ac-panel {
  position: fixed;
  z-index: 9600;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .5);
}

.ac-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.ac-row.is-active,
.ac-row:hover { background: var(--surface-2); }

/* The symbol is what gets typed, so it leads and never wraps. */
.ac-sym {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* The company name is how you tell two listings apart, so it keeps its room.
   Without a min-width the exchange badge wins the flex fight and "NVIDIA
   Corporation" collapses to a single letter next to "Chicago Mercantile
   Exchange". */
.ac-name {
  flex: 1 1 auto;
  min-width: 90px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The exchange is the part you cannot guess: PINELABS, PINELABS.NS and
   PINELABS-BL.NS are three different instruments. */
.ac-exch {
  flex: 0 1 auto;
  /* Yahoo returns display names as long as "International Orderbook - London".
     Truncate rather than let one push the company name off the row. */
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

.ac-empty {
  display: block;
  padding: 10px 11px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ac-empty b { color: var(--text); font-weight: 600; }

.ac-empty span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
}

@media (max-width: 640px) {
  .ac-panel { max-height: 240px; }
  .ac-name { font-size: 11px; }
}
