.task-board {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.task-summary-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.task-summary-next {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.task-summary-next small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-summary-next strong {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.task-summary-next span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: center;
  justify-content: flex-end;
  flex: none;
}

.task-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
}

.task-filter-scroll {
  min-width: 0;
  width: 100%;
  border-bottom: 1px solid var(--panel-border);
}

.task-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0 10px;
  -webkit-overflow-scrolling: touch;
}

.task-filter-tab {
  display: grid;
  gap: 1px;
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(19, 24, 22, 0.72);
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.task-filter-tab[aria-selected='true'] {
  border-color: rgba(214, 130, 88, 0.38);
  background: rgba(214, 130, 88, 0.12);
  color: var(--bg-ink);
}

.task-filter-tab strong {
  font-size: 12px;
}

.task-filter-tab small {
  color: inherit;
  font-size: 10px;
  opacity: 0.85;
}

.task-create-panel {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.task-create-panel > summary {
  padding: 12px 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.task-create-panel > summary::-webkit-details-marker {
  display: none;
}

.task-create-form {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.task-create-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-create-form label,
.task-edit-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-create-form input,
.task-create-form select,
.task-create-form textarea,
.task-edit-form input,
.task-edit-form select,
.task-edit-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--bg-ink);
  font: inherit;
  font-size: 13px;
}

.task-create-form textarea,
.task-edit-form textarea {
  min-height: 72px;
  resize: vertical;
}

.task-create-form button,
.task-edit-form button {
  justify-self: start;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.task-create-form button:disabled,
.task-edit-form button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.task-form-wide {
  grid-column: 1 / -1;
}

.task-lanes {
  display: grid;
  gap: 8px;
}

.task-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.task-group-completed {
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.task-group-completed summary {
  cursor: pointer;
  list-style: none;
}

.task-group-completed summary::-webkit-details-marker {
  display: none;
}

.task-group-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.task-group-head strong {
  font-size: 13px;
  letter-spacing: -0.02em;
}

.task-list {
  display: grid;
  gap: 4px;
}

.task-row {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.task-row-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 10px;
}

.task-row-lead {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
}

.task-row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.task-kind {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-row-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-meta-strip span {
  display: inline-flex;
  max-width: 100%;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-aside {
  display: grid;
  gap: 6px;
  justify-items: end;
  flex: none;
}

.task-row-next {
  display: grid;
  gap: 1px;
  justify-items: end;
  text-align: right;
}

.task-row-next small,
.task-row-next em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.task-row-next strong {
  font-size: 13px;
  letter-spacing: -0.02em;
}

.task-row-actions {
  justify-content: flex-end;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--bg-ink);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.task-action:hover,
.task-action:focus-visible {
  border-color: rgba(214, 130, 88, 0.42);
  outline: none;
  box-shadow: 0 0 0 2px rgba(214, 130, 88, 0.12);
}

.task-action:disabled {
  cursor: progress;
  opacity: 0.55;
}

.task-action.is-busy {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  border-color: rgba(214, 130, 88, 0.32);
  background: rgba(214, 130, 88, 0.12);
}

.task-action.is-busy::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ej-spin 0.7s linear infinite;
}

@keyframes ej-spin {
  to {
    transform: rotate(360deg);
  }
}

.task-action-cancel {
  color: #8f2f22;
  border-color: rgba(183, 71, 52, 0.22);
  background: rgba(183, 71, 52, 0.08);
}

.task-row-details {
  border-top: 1px solid var(--panel-border);
}

.task-row-details > summary {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.task-row-details > summary::-webkit-details-marker {
  display: none;
}

.task-row-details-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.task-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.task-time-grid > span,
.task-suspended,
.task-result {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.task-next-run {
  border-color: rgba(214, 130, 88, 0.25);
  background: rgba(214, 130, 88, 0.08);
}

.task-time-grid small,
.task-suspended span,
.task-result span,
.task-time-grid em,
.task-suspended em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.task-time-grid strong,
.task-suspended strong,
.task-result strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-suspended {
  border-color: rgba(181, 138, 34, 0.22);
  background: rgba(181, 138, 34, 0.08);
}

.task-result {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-color: rgba(63, 127, 81, 0.15);
}

.result-fail {
  border-color: rgba(183, 71, 52, 0.28);
  background: rgba(183, 71, 52, 0.08);
}

.result-none {
  border-color: rgba(109, 115, 95, 0.14);
}

.task-prompt-block {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.task-prompt-block > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-prompt-block p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.task-prompt-block small {
  overflow: hidden;
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-edit {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.task-edit > summary {
  padding: 8px 10px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.task-edit > summary::-webkit-details-marker {
  display: none;
}

.task-edit-form {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.task-group-empty {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.pill-watchers {
  color: #d7f5e7;
  background: rgba(80, 180, 130, 0.14);
}

.pill-scheduled,
.pill-paused {
  color: #f0dfaa;
  background: rgba(181, 138, 34, 0.16);
}

.pill-completed {
  color: var(--muted);
  background: rgba(109, 115, 95, 0.16);
}

@media (max-width: 760px) {
  .task-summary-bar {
    flex-direction: column;
    padding: 10px 12px;
  }

  .task-summary-chips {
    justify-content: flex-start;
  }

  .task-form-grid {
    grid-template-columns: 1fr;
  }

  .task-create-form button {
    width: 100%;
    justify-self: stretch;
  }

  .task-row-head {
    flex-direction: column;
    gap: 8px;
  }

  .task-row-aside {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
  }

  .task-row-next {
    justify-items: start;
    text-align: left;
  }

  .task-row-actions {
    justify-content: flex-end;
  }

  .task-time-grid {
    grid-template-columns: 1fr;
  }

  .task-action {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .task-filter-tab {
    min-width: 64px;
    min-height: 44px;
  }
}
