/* Gleaning activity feed: live display of what's being found */
.glean-feed {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--bs-secondary-color);
  max-height: 10rem;
  overflow-y: auto;
  mask-image: linear-gradient(to bottom, transparent, black 1rem, black calc(100% - 1rem), transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 1rem, black calc(100% - 1rem), transparent);
}

.glean-feed-item {
  animation: feedSlideIn 0.3s ease-out;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes feedSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Suggestion family colors: muted in light mode, lifted in dark.
   Word rides the brand's bright blue and Fact its gold (theme.css). */
:root,
[data-bs-theme="light"] {
  --suggestion-entity: #6f42c1;
  --suggestion-fact: var(--gold);
  --suggestion-passage: #0b7285;
  --suggestion-word: var(--sky);
  --suggestion-seed: #198754;
}

[data-bs-theme="dark"] {
  --suggestion-entity: #b79ce8;
  --suggestion-fact: var(--gold);
  --suggestion-passage: #63c7b2;
  --suggestion-word: var(--sky);
  --suggestion-seed: #8fd18a;
}

.text-suggestion-entity { color: var(--suggestion-entity); }
.text-suggestion-fact { color: var(--suggestion-fact); }
.text-suggestion-passage { color: var(--suggestion-passage); }
.text-suggestion-word { color: var(--suggestion-word); }
.text-suggestion-seed { color: var(--suggestion-seed); }

/* Suggestion filter chips: colored border via currentColor, all/none/one selection */
.suggestion-chip {
  background: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.1rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.5;
  transition: opacity 0.15s ease;
}

.suggestion-chip:hover {
  background-color: color-mix(in srgb, currentColor 10%, transparent);
}

/* Fixed width so toggling Show All / Hide All doesn't shift the chips */
.suggestion-chip-toggle {
  min-width: 4.75rem;
  text-align: center;
}


/* Grouped suggestion section headers */
.suggestion-section-header {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-tertiary-color);
  background-color: var(--bs-tertiary-bg);
}

.suggestion-section .list-group-item {
  font-size: 0.925rem;
}

/* Clip edit/delete: quiet icons that surface on card hover, beside the Done button */
.clip-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .clip-actions,
.card:focus-within .clip-actions {
  opacity: 1;
}

@media (hover: none) {
  .clip-actions {
    opacity: 1;
  }
}

.clip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: none;
  border-radius: 0.375rem;
  background: none;
  color: var(--bs-tertiary-color);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.clip-action:hover {
  background-color: color-mix(in srgb, var(--bs-emphasis-color) 8%, transparent);
  color: var(--bs-emphasis-color);
}

.clip-action-danger:hover {
  background-color: color-mix(in srgb, var(--rose) 12%, transparent);
  color: var(--bs-danger);
}

/* Clip source: a faint citation under the clip's text */
.clip-source {
  font-size: 0.8rem;
  color: var(--bs-tertiary-color);
  text-decoration: none;
}

.clip-source:hover {
  color: var(--bs-primary);
}

#rabbit_hole_sidebar > :empty { display: none; }

/* Suggestion cards animate in */
#rabbit_hole_sidebar [id$="_suggestions"] > .card {
  animation: suggestionSlideIn 0.35s ease-out;
}

/* Suggestions sort themselves: pending on top, then accepted, then
   rejected. A stream replace updates the status attribute and the
   list-group's flex order does the rest. */
.suggestion-sort > [data-suggestion-status="accepted"] {
  order: 1;
}

.suggestion-sort > [data-suggestion-status="rejected"] {
  order: 2;
}

@keyframes suggestionSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inline edit: a reusable textarea that blends into its container */
.inline-edit-field {
  resize: none;
  overflow: hidden;
  min-height: 0;
  field-sizing: content;
}

/* Inbox: the empty-state card and Focus toggle swap on whether the list
   still has children; turbo streams remove settled items one by one, but
   leave each clip's turbo-cable-stream-source subscription behind. */
.inbox-empty {
  display: none;
}

.inbox:not(:has(.inbox-list > :not(turbo-cable-stream-source))) .inbox-empty {
  display: block;
}

.inbox:not(:has(.inbox-list > :not(turbo-cable-stream-source))) .inbox-focus-toggle {
  display: none;
}

/* Preserve newlines in display mode */
.preserve-newlines {
  white-space: pre-line;
}

