.task-view-controls {
  padding: 0 calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
}

/* Same look as Calendar's Day/Week/Month/Schedule toggle (see
   calendar.css) — duplicated rather than shared since each page owns its
   own stylesheet here, but kept visually identical on purpose. */
.view-toggle {
  display: flex;
  width: fit-content;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.view-toggle button {
  border: none;
  border-radius: 0;
  background-color: var(--color-surface);
  color: var(--color-text-muted);
  padding: 0 calc(var(--spacing-unit) * 2);
  min-height: 42px;
  font-size: 0.9rem;
  font-weight: 500;
}

.view-toggle button:hover {
  background-color: var(--color-bg);
}

.view-toggle button.view-toggle__button--active {
  background-color: var(--color-primary);
  color: #fff;
}

.task-board {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  padding: calc(var(--spacing-unit) * 3);
  overflow-x: auto;
  align-items: flex-start;
}

/* Upcoming view: an agenda grouped by date, mirroring Calendar's Schedule
   view (.schedule-* in calendar.css) so the two "what's coming up" views
   in this app feel like the same idea. */
.task-upcoming {
  padding: 0 calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
  max-width: 640px;
}

.task-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2.5);
}

.task-upcoming-day__header {
  font-weight: 600;
  padding-bottom: calc(var(--spacing-unit));
  border-bottom: 1px solid var(--color-border);
  margin-bottom: calc(var(--spacing-unit));
}

.task-upcoming-row {
  display: flex;
  gap: calc(var(--spacing-unit) * 1.25);
  align-items: center;
  padding: calc(var(--spacing-unit) * 1.25);
  border-radius: 10px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: calc(var(--spacing-unit));
  cursor: pointer;
}

.task-upcoming-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-upcoming-row__time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  width: 84px;
  flex-shrink: 0;
}

.task-upcoming-row__title {
  flex: 1;
}

.task-upcoming-empty {
  color: var(--color-text-muted);
}

.task-column {
  flex: 0 0 260px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.3);
  padding: calc(var(--spacing-unit) * 2);
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1.5);
}

.task-column--drop-target {
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.task-column__header {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit));
}

.task-column__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.task-column__name {
  font-weight: 600;
  font-size: 1.35rem;
  flex: 1;
}

.task-column__count {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.task-category__title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: calc(var(--spacing-unit)) 0 calc(var(--spacing-unit) / 2) 0;
}

/* Today's calendar events, shown read-only at the bottom of each
   column — not a task, so no checkbox and no click-to-open (edit it
   from Calendar instead). Dashed border instead of task-row's solid
   fill keeps it visually distinct from an actual chore at a glance. */
.task-board-event {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 0.75);
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 0.75);
  border-radius: 8px;
  border: 1px dashed var(--color-border);
  margin-bottom: calc(var(--spacing-unit) * 0.35);
}

.task-board-event__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-board-event__time {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  width: 56px;
}

.task-board-event__title {
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-unit);
  padding: calc(var(--spacing-unit) * 0.6) calc(var(--spacing-unit) * 0.75);
  border-radius: 10px;
  background-color: var(--color-bg);
  margin-bottom: calc(var(--spacing-unit) * 0.35);
  cursor: pointer;
}

/* Drag-and-drop states. box-shadow rather than a border for the drop
   indicators so they don't shift layout by their own width. */

.task-row--dragging {
  opacity: 0.35;
}

.task-row--drop-before {
  box-shadow: inset 0 3px 0 0 var(--color-primary);
}

.task-row--drop-after {
  box-shadow: inset 0 -3px 0 0 var(--color-primary);
}

.task-row__handle {
  align-self: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-faint);
  cursor: grab;
  touch-action: none; /* let the drag gesture own touch input here, not page scroll */
}

.task-row__handle svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.task-drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0.95;
  cursor: grabbing;
}

/* A native checkbox's shape/fill isn't stylable enough on its own to get
   a round outline, a per-task fill color, AND a reliably-white check in
   every browser — so this replaces its rendering entirely (appearance:
   none) and draws both by hand. --task-checkbox-color is set inline per
   row in tasks.js from that column's person/pet color, so the checked
   fill always matches the avatar it sits next to; the check itself is
   fixed white regardless, via the ::after tick below. */
.task-row__checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background-color: var(--color-surface);
  cursor: pointer;
  position: relative;
}

.task-row__checkbox:checked {
  background-color: var(--task-checkbox-color, var(--color-primary));
  border-color: var(--task-checkbox-color, var(--color-primary));
}

.task-row__checkbox:checked::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-row__body {
  flex: 1;
  min-width: 0;
}

.task-row__title {
  font-size: 0.98rem;
}

.task-row__title--completed {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.task-row__late {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: 1px;
}

.task-row__recurrence {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-top: 1px;
}

.task-row__claim {
  display: block;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.82rem;
  padding: 0;
  margin-top: calc(var(--spacing-unit) / 4);
  cursor: pointer;
}

.task-quick-add {
  display: flex;
  gap: calc(var(--spacing-unit) / 1.5);
  margin-top: calc(var(--spacing-unit) / 2);
}

.task-quick-add input {
  flex: 1;
  min-height: 40px;
  font-size: 0.9rem;
  padding: 0 calc(var(--spacing-unit) * 1.25);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
}

.task-column__empty {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.task-recurring-fields {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

/* Weekdays/Weekend/Custom days checkbox row. Weekdays and Weekend show
   this same grid pre-checked and disabled (see updateRecurrenceFieldsVisibility
   in tasks.js) rather than hiding it, so it's clear at a glance exactly
   which days those presets mean. */
.day-of-week-picker {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit));
}

.day-of-week-picker label {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) / 2);
  padding: calc(var(--spacing-unit) / 2) calc(var(--spacing-unit));
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.day-of-week-picker input {
  width: 18px;
  height: 18px;
}

/* Almost-doubled task/event text (and a wider column to fit it) for the
   kitchen touchscreen — see the matching query in shell.css for why this
   targets touch capability (specifically `any-pointer: coarse`, not
   plain `pointer`/`hover`) rather than a pixel width range, and keep
   both files' queries identical so the whole app switches to "big"
   together rather than piecemeal. */
@media (min-width: 721px) and (any-pointer: coarse) {
  .task-column {
    flex-basis: 320px;
  }

  .task-category__title {
    font-size: 1rem;
  }

  .task-row__checkbox {
    width: 34px;
    height: 34px;
  }

  .task-row__checkbox:checked::after {
    left: 10px;
    top: 4px;
    width: 8px;
    height: 14px;
  }

  .task-row__title {
    font-size: 1.3rem;
  }

  .task-row__late,
  .task-row__recurrence,
  .task-row__claim {
    font-size: 1.05rem;
  }

  .task-board-event__dot {
    width: 10px;
    height: 10px;
  }

  .task-board-event__time {
    font-size: 0.95rem;
    width: 68px;
  }

  .task-board-event__title {
    font-size: 1.1rem;
  }
}
