/* sort.css — Stage 3 (set priorities): the "Your tasks" list. Each card carries the four priority
   icons (the chosen one ringed green) and a red ✕. No matrix here — the board (Stage 4) shows the
   tagged tasks in their quadrants. */

.sort__list-panel {
  max-width: 640px;
  margin: var(--space-5) auto 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--hover);
}

.sort__list-head {
  margin-bottom: var(--space-3);
}

.sort__list-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
}

.sort__list-hint {
  margin: 2px 0 0;
  font-size: var(--text-xs);
}

.sort__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 62vh;
  overflow-y: auto;
  overflow-x: hidden; /* only ever a vertical scrollbar */
  padding: 3px; /* room so an active icon's ring is not clipped by the scroll box */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sort__list::-webkit-scrollbar {
  width: 8px;
}

.sort__list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}

.sort__list::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Cards ---------- */
.sort-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 8px 6px 12px;
  box-shadow: var(--shadow-sm);
}

.sort-card__title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-card .task-card__title {
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

/* Four colour-coded priority icons; the active one is ringed green (the chosen tag). */
.priority-icons {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.priority-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  transition:
    background var(--dur-fast),
    color var(--dur-fast),
    box-shadow var(--dur-fast);
}

.priority-icon--do {
  color: var(--red);
}
.priority-icon--plan {
  color: var(--yellow);
}
.priority-icon--delegate {
  color: var(--blue);
}
.priority-icon--delete {
  color: var(--gray);
}

.priority-icon:hover {
  background: var(--surface-2);
}

.priority-icon.is-active {
  box-shadow: 0 0 0 2px var(--focus); /* the selection ring, green */
  background: color-mix(in srgb, var(--focus) 12%, transparent);
}

/* Red ✕ that deletes the task (with Undo). */
.sort-card__delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--red);
  opacity: 0.5;
  transition:
    opacity var(--dur-fast),
    background var(--dur-fast);
}

.sort-card__delete:hover,
.sort-card__delete:focus-visible {
  opacity: 1;
  background: var(--red-fill);
}

.sort-card__delete svg {
  width: 15px;
  height: 15px;
}

.sort__done {
  padding: 10px 14px;
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: center;
}

@media (pointer: coarse) {
  .priority-icon,
  .sort-card__delete {
    width: var(--touch);
    height: var(--touch);
  }
}
