/* ═══════════════════════════════════════════════════════════════════════════
   search/ui/search.css — the unified search results panel (#hzSearchPanel)

   Owned entirely by search/ui/addon.js. Nothing else styles
   `.hzs*`, and removing the addon removes the feature with no dangling CSS.

   ── Design notes ─────────────────────────────────────────────────────────
   The panel is deliberately NOT a new visual language. It sits in the sidebar
   where the chat list was, and a result row is the chat row's own rhythm — the
   same 11px gap, the same 9px/10px padding, the same 12px radius as `.ci` —
   so switching between the list and its search results reads as one surface
   filtering itself, not as an overlay appearing on top of it.

   Every value is a design-system token. The only genuinely new atoms are the
   section heading (`.hzs-hd`), the "Agent" tag on store results, and the
   Ask-Harizma fallback card — each of which exists because there is no
   existing atom for it, not because it looked nicer.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The panel replaces the list in flow, so the sidebar keeps its own scroll and
   the phone viewport needs no second scroll container. */
.hzs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--hz-space-1) var(--hz-space-2) var(--hz-space-4);
}

/* What the panel hides while it is open. A class rather than inline display so
   the host screens keep ownership of their own layout rules. */
.hzs-hidden { display: none !important; }

/* ── Section ─────────────────────────────────────────────────────────────── */
.hzs-sec { margin-bottom: var(--hz-space-3); }
.hzs-sec:last-child { margin-bottom: 0; }

.hzs-hd {
  font-size: var(--hz-text-2xs);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  /* --hz-text-meta, not --t3. A section header is a LABEL, and the design
     system reserves --hz-text-subtle for decoration precisely because it does
     not survive being read — this measured 1.69:1 in dark and 2.31:1 in light,
     against a 4.5 floor. Same defect the `meta` role was introduced to fix. */
  color: var(--hz-text-meta);
  padding: var(--hz-space-2) var(--hz-space-3) var(--hz-space-1);
}

/* The promoted answer. One hairline rule under it is the whole treatment: it
   separates "the answer" from "everything else" without turning the first row
   into a different component. */
.hzs-sec--top { border-bottom: 1px solid var(--border); padding-bottom: var(--hz-space-2); }

/* ── Row ─────────────────────────────────────────────────────────────────── */
.hzs-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: var(--hz-radius-12);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  color: var(--t1);
  transition: background .14s var(--ease);
}
.hzs-row:hover,
.hzs-row.on { background: var(--hover); }
/* Keyboard focus must be visible even though the cursor is driven from the
   input: rows carry tabindex="-1" and never receive focus themselves, so `.on`
   is the focus ring's stand-in and gets a real outline. */
.hzs-row.on { outline: 2px solid var(--accent); outline-offset: -2px; }
.hzs-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.hzs-av {
  width: 40px; height: 40px;
  flex: none;
  border-radius: var(--hz-radius-avatar);   /* the avatar circle — agents and chats alike */
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.hzs-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hzs-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }

.hzs-t {
  font-size: var(--hz-text-base);
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hzs-s {
  font-size: var(--hz-text-xs);
  color: var(--t2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Says which source a row came from, so "why is this here?" never needs
   asking. Only agents carry it — in the sidebar every other row is a chat, and
   labelling the majority case is noise. */
.hzs-tag {
  flex: none;
  font-size: var(--hz-text-2xs);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--t3);
  border: 1px solid var(--border);
  border-radius: var(--hz-radius-pill);
  padding: 2px 8px;
}

.hzs-more,
.cs-more {
  display: block;
  width: 100%;
  margin-top: var(--hz-space-2);
  padding: var(--hz-space-2) var(--hz-space-3);
  border: 1px solid var(--border);
  border-radius: var(--hz-radius-12);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: var(--hz-text-sm);
  cursor: pointer;
  text-align: center;
}
.hzs-more:hover,
.cs-more:hover { background: var(--hover); }
.hzs-more:focus-visible,
.cs-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Empty state — never a dead end ──────────────────────────────────────── */
.hzs-empty { padding: var(--hz-space-5) var(--hz-space-3); display: grid; gap: var(--hz-space-4); }

/* The interim note while the agent catalog is still loading. Centred and at the
   empty state's size, so the panel does not jump when the real answer replaces
   it — the state is momentary and must not draw the eye.

   Ink is --hz-text-meta: this is a LABEL the user has to read, and the design
   system reserves --hz-text-subtle for decoration only. Measured on the panel's
   own surface: 6.39:1 dark, 4.64:1 light. The "@" hint (how to find a person
   by username) is the same quiet one-liner. */
.hzs-pending,
.hzs-hint {
  margin: 0;
  padding: var(--hz-space-3);
  font-size: var(--hz-text-sm);
  color: var(--hz-text-meta);
  text-align: center;
}
.hzs-empty-t {
  margin: 0;
  font-size: var(--hz-text-sm);
  color: var(--t2);
  text-align: center;
  overflow-wrap: anywhere;
}
.hzs-ask {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: var(--hz-space-3);
  border: 1px solid var(--border);
  border-radius: var(--hz-radius-14);
  background: var(--raised);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.hzs-ask:hover { border-color: var(--accent); background: var(--hover); }
.hzs-ask:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hzs-ask-ic {
  width: 36px; height: 36px; flex: none;
  border-radius: var(--hz-radius-12);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
  background: linear-gradient(145deg, #0F172A 0%, #1E3A8A 30%, #5B21B6 62%, #BE185D 100%);
}
.hzs-ask-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hzs-ask .hzs-s { white-space: normal; }

/* ── The store's seam ────────────────────────────────────────────────────── */
/* A single row under the store's agent results: "Also 2 chats match …". It is
   what makes two search fields feel like one engine, so it is a link, not a
   card — it points somewhere, it does not hold content. */
.cs-also {
  display: flex; align-items: center; gap: var(--hz-space-2);
  width: 100%;
  margin-top: var(--hz-space-3);
  padding: var(--hz-space-3);
  border: 1px dashed var(--border);
  border-radius: var(--hz-radius-14);
  background: transparent;
  color: var(--t2);
  font-family: inherit;
  font-size: var(--hz-text-sm);
  cursor: pointer;
  text-align: start;
  transition: border-color .14s var(--ease), color .14s var(--ease);
}
.cs-also:hover { border-color: var(--accent); color: var(--t1); }
.cs-also:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cs-also-arrow { margin-inline-start: auto; flex: none; opacity: .7; }

/* ── Phone ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hzs { padding-bottom: calc(var(--hz-space-8) + env(safe-area-inset-bottom, 0px)); }
  .hzs-row { padding: 10px; }
  .hzs-av { width: 44px; height: 44px; }   /* touch target parity with .ci */
  .hzs-t { font-size: var(--hz-text-md); }
}

@media (prefers-reduced-motion: reduce) {
  .hzs-row, .hzs-ask, .cs-also { transition: none; }
}
