/* Tasks (tasks.js): the side panel, and tasks in the calendar. */

.tasks-toggle.on { background: var(--selected); color: var(--accent-ink); }

/* The panel sits outside the shell, so the mail list refreshing never
   wipes what is being typed in it; the shell makes room for it. */
.shell.with-tasks { padding-right: 336px; }
.tasks-panel {
  position: fixed; top: 64px; right: 16px; bottom: 16px; width: 320px; z-index: 20;
  background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.tasks-head { display: flex; align-items: center; gap: 2px; padding: 8px 4px 4px 16px; }
.tasks-kicker { font-size: 11px; letter-spacing: .8px; color: var(--text-3); font-weight: 500; }
.tasks-listbtn {
  border: 0; background: none; padding: 2px 4px 2px 0; display: inline-flex; align-items: center; gap: 2px;
  font-size: 18px; cursor: pointer; max-width: 200px;
}
.tasks-listbtn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tasks-listbtn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.tasks-from { font-size: 12px; padding: 0 16px 4px; }
.tasks-add {
  display: flex; align-items: center; gap: 12px; border: 0; background: none; color: var(--accent-ink);
  padding: 10px 16px; font-weight: 500; cursor: pointer; text-align: left;
}
.tasks-add:hover { background: var(--hover); }
.tasks-add svg { width: 22px; height: 22px; fill: currentColor; }
.tasks-body { flex: 1; overflow-y: auto; padding-bottom: 16px; }

.tasks-row { display: flex; align-items: flex-start; gap: 4px; padding: 4px 8px 4px 6px; position: relative; }
.tasks-row:hover { background: var(--hover); }
.tasks-row.dragging { opacity: .4; }
.tasks-row.drop { box-shadow: inset 0 2px 0 var(--accent-ink); }
.tasks-check {
  width: 36px; height: 36px; flex: none; border: 0; background: none; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); cursor: pointer;
}
button.tasks-check:hover { background: var(--surface-2); color: var(--accent-ink); }
.tasks-check svg { width: 20px; height: 20px; fill: currentColor; }
.tasks-row.done .tasks-check { color: var(--accent-ink); }
.tasks-main { flex: 1; min-width: 0; padding: 8px 0 6px; cursor: pointer; outline-offset: 2px; }
.tasks-title { overflow-wrap: anywhere; }
.tasks-row.done .tasks-title { text-decoration: line-through; color: var(--text-3); }
.tasks-notes {
  font-size: 12px; color: var(--text-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  white-space: pre-line;
}
.tasks-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; }
.tasks-due {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
  color: var(--text-2);
}
.tasks-due svg { width: 14px; height: 14px; fill: currentColor; }
.tasks-due.late { color: var(--danger); border-color: currentColor; }
.tasks-email {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); padding: 1px 8px; font-size: 12px; cursor: pointer; color: var(--text-2);
}
.tasks-email:hover:not(:disabled) { background: var(--selected); }
.tasks-email:disabled { cursor: default; opacity: .7; }
.tasks-email span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tasks-email svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.tasks-grip { opacity: 0; align-self: center; color: var(--text-3); cursor: grab; }
.tasks-grip svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.tasks-row:hover .tasks-grip { opacity: 1; }
.tasks-new input { width: 100%; border: 0; border-bottom: 1px solid var(--accent-ink); background: transparent; outline: 0; padding: 2px 0; }
.tasks-group { font-size: 12px; font-weight: 500; color: var(--text-3); padding: 12px 16px 2px; }
.tasks-donebtn {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none;
  padding: 12px 16px; margin-top: 8px; cursor: pointer; font-weight: 500; color: var(--text-2); text-align: left;
}
.tasks-donebtn svg { width: 20px; height: 20px; fill: currentColor; transform: rotate(-90deg); transition: transform .15s; }
.tasks-donebtn[aria-expanded="true"] svg { transform: none; }
.tasks-empty { text-align: center; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tasks-art { width: 96px; height: 96px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--seaglass); margin-bottom: 8px; }
.tasks-art svg { width: 56px; height: 56px; fill: var(--teal); }
[data-scheme="dark"] .tasks-art svg { fill: var(--seaglass); }

.tasks-menu .menu-item { display: flex; align-items: center; gap: 8px; }
.tasks-menu .menu-item:disabled { opacity: .5; cursor: default; }
.tasks-mname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-msub { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-note { font-size: 12px; padding: 4px 16px 8px; }

.tasks-detail { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.tasks-detail textarea, .tasks-detail input, .tasks-detail select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--surface); min-width: 0;
}
.tasks-detail textarea { resize: vertical; width: 100%; }
.tasks-detail .tasks-dtitle { font-size: 18px; border-color: transparent; border-bottom-color: var(--line); border-radius: 0; resize: none; padding: 6px 0; }
.tasks-detail :focus { outline: 2px solid var(--accent-ink); outline-offset: -1px; }
.tasks-field { display: flex; align-items: flex-start; gap: 12px; }
.tasks-field > svg { width: 20px; height: 20px; fill: var(--text-3); flex: none; margin-top: 8px; }
.tasks-field > :not(svg) { flex: 1; min-width: 0; }
.tasks-when { display: flex; gap: 8px; }
.tasks-when input { flex: 1; min-width: 0; }
.tasks-hint { font-size: 12px; margin: -6px 0 0 32px; }
.tasks-linked { display: flex; flex-direction: column; gap: 2px; font-size: 12px; padding-top: 6px; }
.tasks-detail > .btn { align-self: flex-start; }

/* In the calendar: an outlined chip with a check circle, apart from the
   filled event chips. */
.chip.task-chip {
  display: flex; align-items: center; gap: 4px; background: var(--surface); color: var(--accent-ink);
  border: 1px solid var(--accent-ink); line-height: 18px;
}
.chip.task-chip span { overflow: hidden; text-overflow: ellipsis; }
.chip.task-chip svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.chip.task-chip.done span { text-decoration: line-through; opacity: .7; }

@media (max-width: 860px) {
  .shell.with-tasks { padding-right: 0; }
  .tasks-panel { top: 64px; right: 0; left: 0; bottom: 64px; width: auto; border-radius: 0; z-index: 45; box-shadow: var(--shadow); }
}
