/* 15 named list & feed patterns */

/* Shared list shell */
.list-shell {
  background: #fff;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.list-shell__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.list-shell__head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.list-shell__head p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-weight: 600;
}

.list-shell__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.list-searchbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
  max-width: 16rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.list-searchbox input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.list-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ========== 1. Inbox rows ========== */
.list-inbox__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  text-align: left;
  color: inherit;
}

.list-inbox__row:hover {
  background: #f7f9fb;
}

.list-inbox__row.is-active {
  background: var(--accent-soft);
}

.list-inbox__from {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.list-inbox__subject {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-inbox__preview {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-inbox__meta {
  text-align: right;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ========== 2. Inbox rich ========== */
.list-inbox-rich__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.list-inbox-rich__row.is-unread {
  background: #f3faf8;
  box-shadow: inset 3px 0 0 var(--accent);
}

.list-inbox-rich__row.is-unread .list-inbox__from,
.list-inbox-rich__row.is-unread .list-inbox__subject {
  font-weight: 800;
}

.list-inbox-rich__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.list-inbox-rich__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

/* ========== 3. Inbox selectable ========== */
.list-inbox-select__bulk {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.list-inbox-select.has-selection .list-inbox-select__bulk,
.list-inbox-select:has([data-list-check]:checked) .list-inbox-select__bulk {
  display: flex;
}

.list-inbox-select__row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-inbox-select__row:hover {
  background: #f7f9fb;
}

.list-inbox-select__row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.list-inbox-select__row.is-checked {
  background: #f3faf8;
}

/* ========== 4. Notifications ========== */
.list-notify__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-notify__row.is-unread {
  background: #f8fafc;
}

.list-notify__icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.list-notify__icon--warn {
  background: #fffaeb;
  color: var(--warn);
}

.list-notify__icon--danger {
  background: #fef3f2;
  color: var(--danger);
}

.list-notify__body {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink);
}

.list-notify__body strong {
  font-weight: 800;
}

.list-notify__time {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ========== 5. Notifications by day ========== */
.list-notify-day__label {
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: #f3f6f9;
  border-bottom: 1px solid var(--border);
}

/* ========== 6. Comment thread ========== */
.list-comments {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  background: #fff;
}

.list-comments__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
}

.list-comments__bubble {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
}

.list-comments__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
}

.list-comments__meta strong {
  font-size: 0.8125rem;
  color: var(--ink);
}

.list-comments__meta span {
  color: var(--ink-faint);
  font-weight: 600;
}

.list-comments__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.list-comments__actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.list-comments__actions button {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.list-comments__composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: start;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.list-comments__composer textarea {
  width: 100%;
  min-height: 2.75rem;
  resize: vertical;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
}

/* ========== 7. Nested replies ========== */
.list-comments-nested__replies {
  margin: 0.65rem 0 0 2.9rem;
  padding: 0 0 0 0.85rem;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 0.65rem;
}

@media (max-width: 40rem) {
  .list-comments-nested__replies {
    margin-left: 1.25rem;
  }
}

/* ========== 8. Search results ========== */
.list-search__row {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-search__row:hover {
  background: #f7f9fb;
}

.list-search__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.list-search__url {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
}

.list-search__snippet {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.list-search__snippet mark {
  background: #d9ebe8;
  color: var(--accent-deep);
  padding: 0 0.15rem;
  border-radius: 3px;
}

/* ========== 9. Search + filters ========== */
.list-search-filter {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  min-height: 18rem;
  background: #fff;
}

.list-search-filter__rail {
  padding: 0.85rem 0.75rem;
  border-right: 1px solid var(--border);
  background: #f7f9fb;
}

.list-search-filter__rail h4 {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.list-search-filter__rail label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}

.list-search-filter__rail input {
  accent-color: var(--accent);
}

.list-search-filter__main {
  min-width: 0;
}

.list-search-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

.list-chip button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 40rem) {
  .list-search-filter {
    grid-template-columns: 1fr;
  }

  .list-search-filter__rail {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    align-items: center;
  }

  .list-search-filter__rail h4 {
    width: 100%;
    margin-bottom: 0.15rem;
  }

  .list-search-filter__rail label {
    margin-bottom: 0;
  }
}

/* ========== 10. Contacts / CRM ========== */
.list-contacts__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-contacts__row:hover {
  background: #f7f9fb;
}

.list-contacts__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.list-contacts__role {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-weight: 600;
}

.list-contacts__actions {
  display: flex;
  gap: 0.35rem;
}

@media (max-width: 40rem) {
  .list-shell__head .list-searchbox {
    max-width: none;
    flex: 1 1 100%;
  }

  .list-contacts__row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem 0.75rem;
  }

  .list-contacts__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .list-contacts__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ========== 11. Mentions ========== */
.list-mentions__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-mentions__text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.list-mentions__text .at {
  color: var(--accent-deep);
  font-weight: 800;
}

.list-mentions__context {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid var(--border-strong);
  background: #f7f9fb;
  border-radius: 0 8px 8px 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ========== 12. Chat messages ========== */
.list-chat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  background: #eef2f6;
  min-height: 16rem;
}

.list-chat__msg {
  display: flex;
  gap: 0.5rem;
  max-width: min(100%, 22rem);
}

.list-chat__msg--mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.list-chat__bubble {
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--ink);
}

.list-chat__msg--mine .list-chat__bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.list-chat__time {
  margin-top: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.list-chat__msg--mine .list-chat__time {
  text-align: right;
  color: rgb(255 255 255 / 0.75);
}

/* ========== 13. Ticket queue ========== */
.list-queue__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-queue__row:hover {
  background: #f7f9fb;
}

.list-queue__id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.list-queue__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.list-queue__sub {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.list-queue__prio {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-queue__prio--high {
  color: var(--danger);
}

.list-queue__prio--med {
  color: var(--warn);
}

.list-queue__prio--low {
  color: var(--ink-faint);
}

@media (max-width: 40rem) {
  .list-queue__row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "id title"
      "prio title";
  }

  .list-queue__id {
    grid-area: id;
  }

  .list-queue__prio {
    grid-area: prio;
  }

  .list-queue__main {
    grid-area: title;
  }

  .list-queue__assignee {
    display: none;
  }
}

/* ========== 14. Social feed ========== */
.list-social {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #e8edf3;
}

.list-social__card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.list-social__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.list-social__head strong {
  display: block;
  font-size: 0.875rem;
}

.list-social__head span {
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-weight: 600;
}

.list-social__body {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.list-social__media {
  height: 7rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #d9ebe8 0%, #c5d4e0 55%, #9bb8ad 100%);
}

.list-social__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.list-social__actions button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
}

.list-social__actions button:hover {
  color: var(--accent-deep);
}

/* ========== 15. People / follow list ========== */
.list-people__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list-people__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.list-people__bio {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.list-people__foot {
  display: flex;
  justify-content: center;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.list-people__foot[hidden] {
  display: none;
}
