/* ----------------------------------------------------------------------------
   citations.css — What sits under an answer: document citation chips, web-source chips
   from Gemini grounding, and the Google Search Suggestions widget.
   Slice 10 of 16 (see css/tokens.css for the full load order).
   ------------------------------------------------------------------------- */
/* citations — rendered below the bubble, not inside it */
.citations {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.cite-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 8px;
  font-weight: 500;
}

.chip {
  display: inline-block;
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  margin: 2px 6px 2px 0;
}

/* non-file fragments in a source list (folder mentions, prose) — plain notes */
.chip-note {
  color: var(--muted);
}

/* document-citation chips download their source on click */
.chip-doc {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.chip-doc:hover,
.chip-doc:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

/* a cited filename that matches nothing in the library (renderCitations) —
   after .chip so its dashed border wins the same-specificity cascade */
.chip-missing {
  border: 1px dashed color-mix(in srgb, var(--danger-text) 50%, transparent);
  color: var(--danger-text);
  opacity: 0.8;
  cursor: default;
  text-decoration: line-through;
}

/* Web sources from Gemini grounding: compact link chips carrying the site's
   favicon, de-duped to one per domain (with a count badge when a domain
   appears more than once). Both chip types share a metric + accent-tinted look
   so the row reads as on-brand and the "+N more" button lines up exactly. */
.web-sources {
  margin-top: 6px;
}

a.web-chip,
.web-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

a.web-chip {
  max-width: 220px;
  text-decoration: none;
  color: var(--text);
  padding: 4px 9px 4px 7px;
}

a.web-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}

.web-fav {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--surface);
}

.web-fav-fallback {
  width: auto;
  height: auto;
  font-size: 11px;
  line-height: 1;
  border-radius: 0;
  background: none;
}

.web-dom {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-count {
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.web-more {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  padding: 5px 10px;
}

.web-more:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}

/* Google Search Suggestions widget (required alongside grounded answers).
   Rendered inside a shadow root (see app.js) so its styles are isolated — this
   host just gives it breathing room and lets it scroll rather than stretch the
   bubble. Its internal colours are Google's own and shown as provided. */
.search-suggestions {
  margin-top: 8px;
  max-width: 100%;
  overflow-x: auto;
}

.chat-pending {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-top: 12px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-input-bar:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.chat-input-bar input {
  flex: 1;
  height: 38px;
  border: none;
  background: none;
  padding: 0 4px;
  font-size: 15px;
}

.chat-input-bar input:focus-visible {
  box-shadow: none;
  outline: none;
}

