/* A compact, current-section list. JavaScript chooses 1–3 columns from its length and viewport. */
.task-picker {
  --task-columns: 1;
  --task-rows: 1;
  --task-column-width: 180px;
  width: min(calc(100vw - 24px), calc(var(--task-columns) * var(--task-column-width) + 26px));
  min-width: min(300px, calc(100vw - 24px));
  height: auto;
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #666;
  color: #eee;
  background: #0b0b0b;
}

.task-picker::backdrop { background: rgb(0 0 0 / 85%); }

.picker-surface {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: calc(100dvh - 26px);
}

.picker-header {
  padding: 12px;
  border-bottom: 1px solid #444;
}

.picker-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.picker-title-row h2 { font-size: 20px; font-weight: 400; }
.picker-actions { display: flex; align-items: center; gap: 8px; }
.picker-actions button { padding: 5px 7px; color: #bbb; font-size: 11px; }

.picker-content {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(var(--task-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--task-rows), minmax(38px, auto));
  grid-auto-flow: column;
  gap: 4px;
}

.picker-task {
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
  background: #101010;
}

.picker-task[aria-current=true] { border-color: white; background: #202020; }
