.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 8px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.list-heading {
  min-width: 0;
}

.list-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.list-subtitle {
  margin-top: 1px;
  color: var(--fg-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.list-notice:empty {
  display: none;
}

.list-notice {
  padding: 8px 12px 0;
}

.list-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  outline: none;
}

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

.thread-row {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.thread-link {
  display: block;
  width: 100%;
  padding: 10px 16px 11px 30px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.thread-link:hover {
  background: var(--bg-hover);
}

.thread-link:focus-visible {
  outline-offset: -2px;
}

.thread-row.is-selected .thread-link {
  background: var(--bg-active);
  box-shadow: inset 3px 0 0 var(--accent);
}

.row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.unread-dot {
  position: absolute;
  left: 13px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.is-unread .unread-dot {
  background: var(--unread);
}

.row-from {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.row-count {
  min-width: 0;
  height: auto;
  padding: 0;
  background: none;
  color: var(--fg-muted);
  font-weight: 500;
}

.row-draft {
  color: var(--danger);
  font-size: var(--text-xs);
  font-weight: 650;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 8px;
  color: var(--fg-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.row-attachment {
  display: inline-flex;
}

.row-attachment .icon {
  width: 15px;
  height: 15px;
}

.row-subject {
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-preview {
  display: block;
  margin-top: 1px;
  padding-right: 28px;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-unread .row-from,
.is-unread .row-subject {
  font-weight: 700;
}

.is-unread .row-date {
  color: var(--fg);
  font-weight: 650;
}

/* Row actions: the star stays; the others appear on hover over the date. */
.row-actions {
  pointer-events: none;
}

.row-actions .icon-button {
  pointer-events: auto;
  width: 30px;
  height: 30px;
}

.row-star {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: var(--fg-subtle);
}

.row-star.is-starred {
  color: var(--star);
}

.row-star .icon {
  width: 17px;
  height: 17px;
}

.row-hover-actions {
  position: absolute;
  top: 5px;
  right: 8px;
  display: none;
  gap: 2px;
  padding-left: 8px;
}

@media (hover: hover) {
  .thread-row:hover .row-hover-actions {
    display: flex;
  }

  /* The actions take the date's place. */
  .thread-row:hover .row-meta {
    visibility: hidden;
  }
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 16px;
}

/* ---- states ---- */

.list-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 340px;
  margin: 0 auto;
  padding: 56px 24px;
  text-align: center;
}

.list-state-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  color: var(--fg-subtle);
  stroke-width: 1.5;
}

.list-state.is-error .list-state-icon {
  color: var(--danger);
}

.list-state-heading {
  font-size: var(--text-lg);
  font-weight: 650;
}

.list-state-text {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin-bottom: 8px;
}

.thread-list.is-skeleton li {
  padding: 12px 16px 12px 30px;
  border-bottom: 1px solid var(--line);
}
